javax.media.j3d
Class MasterControl

java.lang.Object
  extended by javax.media.j3d.MasterControl

 class MasterControl
extends java.lang.Object


Nested Class Summary
(package private) static class MasterControl.TimeType
           
 
Field Summary
(package private) static java.lang.Integer ACTIVATE_VIEW
           
private  UnorderList activeUniverseList
          The list of active universes get from View
(package private)  boolean allowNullGraphicsConfig
           
(package private)  boolean allowSoleUser
           
private static boolean appletLauncher
           
(package private)  long awt
           
(package private)  boolean buildDisplayListIfPossible
           
(package private)  boolean cacheAutoComputedBounds
           
private  int canvasFreeIndex
           
private  java.lang.Object canvasIdLock
           
private  boolean[] canvasIds
           
(package private) static boolean cgLibraryAvailable
           
(package private) static int CHECK_FOR_WORK
          Options for the runMonitor
private  CompressedGeometryRenderMethod compressedGeometryRenderMethod
          The compressed geometry rendering method
(package private)  java.lang.Object contextCreationLock
           
private  long contextTimeStamp
           
private static java.util.logging.Logger coreLogger
           
private static boolean coreLoggerEnabled
           
private  int cpuLimit
          The number of cpu's Java 3D may use
private  long currentTime
          The current time snapshots
(package private) static java.lang.Integer DEACTIVATE_VIEW
           
private  DefaultRenderMethod defaultRenderMethod
          The default rendering method
(package private)  java.util.Hashtable deviceScreenMap
           
private static java.util.logging.Logger devLogger
           
private static boolean devLoggerEnabled
           
(package private)  boolean disableCompile
           
(package private)  boolean disableSeparateSpecularColor
           
private  DisplayListRenderMethod displayListRenderMethod
          The displayList rendering method
(package private)  boolean doCompaction
           
(package private)  boolean doDsiRenderLock
           
(package private) static java.lang.Integer EMPTY_UNIVERSE
           
(package private)  boolean enforcePowerOfTwo
           
(package private)  boolean forceReleaseView
           
(package private)  int frameCount
           
private  int frameCountCutoff
           
private  long frameCycleNumber
           
private  int frameCycleTick
           
(package private) static java.lang.Integer FREE_CONTEXT
           
(package private) static java.lang.Integer FREE_DRAWING_SURFACE
           
(package private) static java.lang.Integer FREE_MESSAGE
           
(package private) static java.lang.Integer FREECONTEXT_CLEANUP
           
private  UnorderList freeMessageList
           
(package private) static java.lang.Integer GETBESTCONFIG
           
(package private) static int globalShadingLanguage
           
(package private) static boolean glslLibraryAvailable
           
(package private)  int glslVertexAttrOffset
           
(package private)  boolean implicitAntialiasing
           
(package private) static java.lang.Integer INPUTDEVICE_CHANGE
           
private  UnorderList inputDeviceThreads
          The list of input device scheduler thread
(package private)  boolean isCompiledVertexArray
           
(package private) static java.lang.Integer ISCONFIGSUPPORT
           
(package private)  boolean isDisplayList
           
private static boolean isMacOs
           
(package private)  boolean isSharedCtx
           
private static boolean isWindowsOs
           
private  int lastStructureUpdateThread
           
private  int lastTransformStructureThread
          Markers for the last transform structure update thread and the last update thread.
private static boolean librariesLoaded
           
private  boolean lockGeometry
          the flag to indicate whether the geometry should be locked or not
(package private)  int maxLights
           
private  MasterControlThread mcThread
          reference to MasterControl thread
private static java.lang.Object mcThreadLock
           
private  UnorderList mirrorObjects
          A list of mirror objects to be updated
(package private) static java.lang.String[] mtype
           
private  NotificationThread notificationThread
           
private  int numActiveViews
          The number of registered views that are active
private  OrientedShape3DRenderMethod orientedShape3DRenderMethod
          The oriented shape3D rendering method
private  boolean pendingRequest
           
(package private) static java.lang.Integer PHYSICAL_ENV_CHANGE
           
(package private) static java.lang.Integer REEVALUATE_CANVAS
           
private  UnorderList regUniverseList
          The list of universes register from View
(package private) static java.lang.Integer REMOVEALLCTXS_CLEANUP
           
(package private) static java.lang.Integer REMOVECTX_CLEANUP
           
(package private) static java.lang.Integer REMOVENOTIFY_CLEANUP
           
(package private) static java.lang.Integer RENDER
           
(package private) static java.lang.Integer RENDER_ONCE
           
(package private)  java.lang.Object[] rendererCleanupArgs
           
private  int rendererCount
           
private  RenderingAttributesStructure renderingAttributesStructure
          The renderingAttributesStructure for updating node component objects
private  UnorderList renderOnceList
           
private  int renderPending
           
private  UnorderList renderThreadData
          The current list of work threads
private  boolean renderWaiting
          State variables for work lists
private  UnorderList renderWorkThreads
           
(package private)  UnorderList requestObjList
           
(package private) static java.lang.Integer REQUESTRENDER
           
private  UnorderList requestRenderWorkThreads
           
private  boolean requestRenderWorkToDo
          This flag indicates that there is work for requestRenderer
private  UnorderList requestTypeList
           
(package private)  int resendTexTimestamp
           
(package private) static java.lang.Integer RESET_CANVAS
           
(package private) static java.lang.Integer RESETCANVAS_CLEANUP
           
private static java.lang.ThreadGroup rootThreadGroup
           
(package private) static int RUN_RENDERER_CLEANUP
           
(package private) static int RUN_THREADS
           
(package private)  boolean running
          This flag indicates that MC is running
(package private) static int RUNNING
           
(package private) static java.lang.Integer SET_GRAPHICSCONFIG_FEATURES
           
(package private) static java.lang.Integer SET_QUERYPROPERTIES
           
(package private) static java.lang.Integer SET_VIEW
           
(package private) static int SET_WORK
           
(package private) static int SET_WORK_FOR_REQUEST_RENDERER
           
(package private)  boolean sharedStereoZBuffer
           
(package private) static int SLEEPING
           
private  long sleepTime
           
(package private)  boolean sortShape3DBounds
           
(package private) static java.lang.Integer START_RENDERER
           
(package private) static java.lang.Integer START_VIEW
           
private  int[] statCounts
           
private  int state
          The current state of the MC thread
private  int statePending
           
private  boolean stateWaiting
           
private  UnorderList stateWorkThreads
          The current list of work threads
private  boolean[] statSeen
           
private static java.util.logging.Logger statsLogger
           
private static boolean statsLoggerEnabled
           
private  long[] statTimes
           
(package private)  boolean stencilClear
           
(package private) static java.lang.Integer STOP_RENDERER
           
(package private) static java.lang.Integer STOP_VIEW
           
(package private) static java.lang.Integer SWAP
           
(package private) static long systemStartTime
          This is the start time upon which alpha's and behaviors are synchronized to.
private  UnorderList tempViewList
           
private  Text3DRenderMethod text3DRenderMethod
          The text3D rendering method
private  int textureIdCount
           
private  java.lang.Object textureIdLock
           
(package private) static int THREAD_DONE
           
private  boolean threadListsChanged
          A flag that is true when the thread lists need updating
private  int threadPending
          The number of THREAD_DONE messages pending
private static int threadPriority
           
private  long time
          The current "time" value
private  java.lang.Object timeLock
          A lock used for accessing time structures.
(package private)  TimerThread timerThread
           
private  java.util.ArrayList timestampUpdateList
           
(package private)  boolean transparentOffScreen
          by MIK OF CLASSX the flag to indicate whether the background of the offscreen canvas must be transparent or not false by default
(package private) static java.lang.Integer UNREGISTER_VIEW
           
(package private)  boolean useBoxForGroupBounds
           
(package private)  boolean useCombiners
           
(package private)  boolean usePbuffer
          Flag to indicate whether Pbuffers are used for off-screen rendering; true by default.
private  VertexArrayRenderMethod vertexArrayRenderMethod
          The vertex array rendering method
(package private)  boolean vertexAttrsInDisplayList
           
(package private)  boolean viewFrustumCulling
          Flag to indicate whether should renderer view frustum culling is done; true by default.
private  UnorderList views
          The list of views that are currently registered
(package private) static int WAITING_FOR_CPU
           
(package private) static int WAITING_FOR_RENDERER_CLEANUP
           
(package private) static int WAITING_FOR_THREADS
           
private  long waitTimestamp
          Use to assign threadOpts in Renderer thread.
private  boolean workToDo
          This flag indicates that MC has work to do
(package private)  boolean xineramaDisabled
           
 
Constructor Summary
MasterControl()
          Constructs a new MasterControl object.
 
Method Summary
(package private)  void addInputDeviceScheduler(InputDeviceScheduler ds)
           
(package private)  void addMirrorObject(ObjectUpdate o)
          Add an object to the mirror object list
private  void addToStateThreads(J3dThreadData threadData)
           
private  void assignNewPrimaryView(VirtualUniverse univ)
           
private  void clearRenderOnceList()
           
(package private)  UnorderList cloneView()
          Return a clone of View, we can't access individual element of View after getting the size in separate API call without synchronized views.
(package private)  void createMasterControlThread()
          Create and start the MasterControl Thread.
(package private)  void createMCThreads()
          This procedure create MC thread that start together with MC.
private  Renderer createRenderer(java.awt.GraphicsConfiguration gc)
          Create a Renderer if it is not already done so.
private  void createUpdateThread(J3dStructure structure)
           
private  void destroyUniverseThreads(VirtualUniverse univ)
          Destroy all VirtualUniverse related threads.
private  void destroyUpdateThread(J3dStructure structure)
           
(package private)  void doWork()
          This is the MasterControl work method for Java 3D
private  void dumpMessage(java.lang.String str, J3dMessage m)
           
private  java.lang.String dumpThreads(int threads)
           
(package private)  void dumpWorkThreads()
           
private  void emptyMessageList(J3dStructure structure, View v)
           
private  void evaluateAllCanvases()
          Note that we have to go through all views instead of evaluate only the canvas in a single view since each screen may share by multiple view
private  void evaluatePhysicalEnv(View v)
           
(package private)  void freeCanvasId(int canvasId)
           
private  void freeContext(View v)
          Release context associate with view
(package private)  void freeDisplayListId(java.lang.Integer id)
           
(package private)  void freeTexture2DId(int id)
           
(package private)  void freeTexture3DId(int id)
           
(package private) static boolean getBooleanProperty(java.lang.String prop, boolean defaultValue, java.lang.String msg)
           
(package private) static boolean getBooleanProperty(java.lang.String prop, boolean defaultValue, java.lang.String trueMsg, java.lang.String falseMsg)
           
(package private)  int getCanvasId()
           
(package private)  RenderMethod getCompressedGeometryRenderMethod()
          This returns the compressed geometry RenderMethod
(package private)  long getContextTimeStamp()
          This returns a context creation time stamp Note: this has to be called under the contextCreationLock
(package private) static java.util.logging.Logger getCoreLogger()
          Get the core logger -- level is INFO by default SEVERE - Serious internal errors WARNING - Possible internal errors or anomalies INFO - General informational messages FINE - Internal debugging information - somewhat verbose FINER - Internal debugging information - more verbose FINEST - Internal debugging information - most verbose
(package private)  RenderMethod getDefaultRenderMethod()
          This returns the default RenderMethod
(package private) static java.util.logging.Logger getDevLogger()
          Get the developer logger -- OFF by default WARNING - for probable incorrect or inconsistent api usage INFO - for informational messages such as performance hints (less verbose than FINE) FINE - for informational messages from inner loops FINER - using default values which may not be optimal
(package private)  java.lang.Integer getDisplayListId()
          This returns the a unused displayListId
(package private)  RenderMethod getDisplayListRenderMethod()
          This returns the displayList RenderMethod
(package private)  InputDeviceBlockingThread getInputDeviceBlockingThread(InputDevice device)
          Invoke from InputDeviceScheduler to create an InputDeviceBlockingThread.
private  int getNumberOfProcessors()
           
(package private)  RenderMethod getOrientedShape3DRenderMethod()
          This returns the oriented shape3d RenderMethod
private static java.lang.String getProperty(java.lang.String prop)
           
(package private)  int getRendererBit()
          This returns the a unused renderer bit
(package private)  int getRendererId()
          This returns the a unused renderer bit
(package private) static java.util.logging.Logger getStatsLogger()
          Get the stats logger -- OFF by default WARNING - statistical anomalies INFO - basic performance stats - not too verbose and minimally intrusive FINE - somewhat verbose and intrusive FINER - more verbose and intrusive FINEST - most verbose and intrusive
(package private)  RenderMethod getText3DRenderMethod()
          This returns the text3d RenderMethod
(package private)  int getTexture2DId()
          This returns the a unused textureId
(package private)  int getTexture3DId()
           
(package private)  int getThreadPriority()
          Return Java3D thread priority
(package private)  long getTime()
          This method increments and returns the next time value timeLock must get before this procedure is invoked
(package private)  RenderMethod getVertexArrayRenderMethod()
          This returns the vertexArray RenderMethod
private  void handlePendingRequest()
           
private static boolean initLogger(java.util.logging.Logger logger, java.util.logging.Level defaultLevel)
           
private static void initLoggers()
           
(package private) static boolean isAppletLauncher()
          Returns a flag indicating whether the sun.jnlp.applet.launcher system property is set to true.
(package private) static boolean isCoreLoggable(java.util.logging.Level level)
           
(package private)  boolean isD3D()
          Returns whether we are using D3D.
(package private) static boolean isDevLoggable(java.util.logging.Level level)
           
(package private)  boolean isRegistered(View view)
          Return true if view is already registered with MC
(package private) static boolean isStatsLoggable(java.util.logging.Level level)
           
(package private) static boolean isWindows()
          Returns whether we are running on Windows TODO: most code that cares about this should move into the pipeline
(package private) static void loadLibraries()
          Method to create and initialize the rendering Pipeline object, and to load the native libraries needed by Java 3D.
private  void logTimes()
           
private  void manageMemory()
           
(package private)  boolean mcThreadDone()
          This procedure is invoked when isRunning is false.
(package private)  void postRequest(java.lang.Integer type, java.lang.Object obj)
          Post the request in queue
(package private)  void processMessage(J3dMessage message)
          This takes a given message and parses it out to the structures and marks its time value.
(package private)  void processMessage(J3dMessage[] messages)
          This takes an array of messages and parses them out to the structures and marks the time value.
(package private)  void recordTime(MasterControl.TimeType type, long deltaTime)
           
private  void registerView(View v)
          This register a View with MasterControl.
(package private)  void removeInputDeviceScheduler(InputDeviceScheduler ds)
           
(package private)  void runMonitor(int action, UnorderList stateThreadList, UnorderList renderThreadList, UnorderList requestRenderThreadList, J3dThread nthread)
           
(package private)  void sendAllocateCanvasId(Canvas3D c)
           
(package private)  void sendCreateOffScreenBuffer(Canvas3D c)
           
(package private)  void sendDestroyCtxAndOffScreenBuffer(Canvas3D c)
           
(package private)  void sendFreeCanvasId(Canvas3D c)
           
(package private)  void sendMessage(J3dMessage message)
          Send a message to another Java 3D thread.
(package private)  void sendNotification(J3dNotification notification)
          This takes the specified notification message and sends it to the notification thread for processing.
(package private)  void sendRenderMessage(java.awt.GraphicsConfiguration gc, java.lang.Object arg, java.lang.Integer mtype)
          Call from GraphicsConfigTemplate to evaluate current capabilities using Renderer thread to invoke native graphics library functions.
(package private)  void sendRunMessage(int targetThreads)
          Send a message to another Java 3D thread.
(package private)  void sendRunMessage(long waitTime, View view, int targetThreads)
          Send a message to another Java 3D thread.
(package private)  void sendRunMessage(View v, int targetThreads)
          Send a message to another Java 3D thread.
(package private)  void sendRunMessage(VirtualUniverse u, int targetThreads)
          This sends a run message to the given threads.
(package private)  void setThreadPriority(int pri)
          Set thread priority to all threads under Java3D thread group.
(package private)  void setWork()
          A convienence wrapper function for various parts of the system to force MC to run.
(package private)  void setWorkForRequestRenderer()
           
private  void startView(View v)
          This notifies MasterControl to start given view
private  void stopView(View v)
          This notifies MasterControl to stop given view
(package private) static void threadYield()
          Yields the current thread, by sleeping for a small amount of time.
private  void unregisterView(View v)
          This unregister a View with MasterControl.
(package private)  void updateMirrorObjects()
          This updates any mirror objects.
private  void updateTimeValues()
          This snapshots the time values to be used for this iteration.
private  void updateWorkThreads()
          This fun little method does all the hard work of setting up the work thread list.
private  void viewActivate(View v)
          This notifies MasterControl that the given view has been activated
private  void viewDeactivate(View v)
          This notifies MasterControl that the given view has been deactivated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHECK_FOR_WORK

static final int CHECK_FOR_WORK
Options for the runMonitor

See Also:
Constant Field Values

SET_WORK

static final int SET_WORK
See Also:
Constant Field Values

RUN_THREADS

static final int RUN_THREADS
See Also:
Constant Field Values

THREAD_DONE

static final int THREAD_DONE
See Also:
Constant Field Values

SET_WORK_FOR_REQUEST_RENDERER

static final int SET_WORK_FOR_REQUEST_RENDERER
See Also:
Constant Field Values

RUN_RENDERER_CLEANUP

static final int RUN_RENDERER_CLEANUP
See Also:
Constant Field Values

SLEEPING

static final int SLEEPING
See Also:
Constant Field Values

RUNNING

static final int RUNNING
See Also:
Constant Field Values

WAITING_FOR_THREADS

static final int WAITING_FOR_THREADS
See Also:
Constant Field Values

WAITING_FOR_CPU

static final int WAITING_FOR_CPU
See Also:
Constant Field Values

WAITING_FOR_RENDERER_CLEANUP

static final int WAITING_FOR_RENDERER_CLEANUP
See Also:
Constant Field Values

REQUESTRENDER

static final java.lang.Integer REQUESTRENDER

RENDER

static final java.lang.Integer RENDER

SWAP

static final java.lang.Integer SWAP

ACTIVATE_VIEW

static final java.lang.Integer ACTIVATE_VIEW

DEACTIVATE_VIEW

static final java.lang.Integer DEACTIVATE_VIEW

START_VIEW

static final java.lang.Integer START_VIEW

STOP_VIEW

static final java.lang.Integer STOP_VIEW

REEVALUATE_CANVAS

static final java.lang.Integer REEVALUATE_CANVAS

UNREGISTER_VIEW

static final java.lang.Integer UNREGISTER_VIEW

PHYSICAL_ENV_CHANGE

static final java.lang.Integer PHYSICAL_ENV_CHANGE

INPUTDEVICE_CHANGE

static final java.lang.Integer INPUTDEVICE_CHANGE

EMPTY_UNIVERSE

static final java.lang.Integer EMPTY_UNIVERSE

START_RENDERER

static final java.lang.Integer START_RENDERER

STOP_RENDERER

static final java.lang.Integer STOP_RENDERER

RENDER_ONCE

static final java.lang.Integer RENDER_ONCE

FREE_CONTEXT

static final java.lang.Integer FREE_CONTEXT

FREE_DRAWING_SURFACE

static final java.lang.Integer FREE_DRAWING_SURFACE

FREE_MESSAGE

static final java.lang.Integer FREE_MESSAGE

RESET_CANVAS

static final java.lang.Integer RESET_CANVAS

GETBESTCONFIG

static final java.lang.Integer GETBESTCONFIG

ISCONFIGSUPPORT

static final java.lang.Integer ISCONFIGSUPPORT

SET_GRAPHICSCONFIG_FEATURES

static final java.lang.Integer SET_GRAPHICSCONFIG_FEATURES

SET_QUERYPROPERTIES

static final java.lang.Integer SET_QUERYPROPERTIES

SET_VIEW

static final java.lang.Integer SET_VIEW

devLoggerEnabled

private static boolean devLoggerEnabled

devLogger

private static java.util.logging.Logger devLogger

statsLoggerEnabled

private static boolean statsLoggerEnabled

statsLogger

private static java.util.logging.Logger statsLogger

coreLoggerEnabled

private static boolean coreLoggerEnabled

coreLogger

private static java.util.logging.Logger coreLogger

librariesLoaded

private static boolean librariesLoaded

appletLauncher

private static boolean appletLauncher

mcThread

private MasterControlThread mcThread
reference to MasterControl thread


views

private UnorderList views
The list of views that are currently registered


transparentOffScreen

boolean transparentOffScreen
by MIK OF CLASSX the flag to indicate whether the background of the offscreen canvas must be transparent or not false by default


usePbuffer

boolean usePbuffer
Flag to indicate whether Pbuffers are used for off-screen rendering; true by default. Set by the "j3d.usePbuffer" property, When this flag is set to false, Bitmap (Windows) or Pixmap (UNIX) rendering will be used


viewFrustumCulling

boolean viewFrustumCulling
Flag to indicate whether should renderer view frustum culling is done; true by default. Set by the -Dj3d.viewFrustumCulling property, When this flag is set to false, the renderer view frustum culling is turned off.


lockGeometry

private boolean lockGeometry
the flag to indicate whether the geometry should be locked or not


numActiveViews

private int numActiveViews
The number of registered views that are active


activeUniverseList

private UnorderList activeUniverseList
The list of active universes get from View


regUniverseList

private UnorderList regUniverseList
The list of universes register from View


timeLock

private java.lang.Object timeLock
A lock used for accessing time structures.


time

private long time
The current "time" value


waitTimestamp

private long waitTimestamp
Use to assign threadOpts in Renderer thread.


stateWorkThreads

private UnorderList stateWorkThreads
The current list of work threads


renderWorkThreads

private UnorderList renderWorkThreads

requestRenderWorkThreads

private UnorderList requestRenderWorkThreads

renderThreadData

private UnorderList renderThreadData
The current list of work threads


inputDeviceThreads

private UnorderList inputDeviceThreads
The list of input device scheduler thread


threadListsChanged

private boolean threadListsChanged
A flag that is true when the thread lists need updating


lastTransformStructureThread

private int lastTransformStructureThread
Markers for the last transform structure update thread and the last update thread.


lastStructureUpdateThread

private int lastStructureUpdateThread

currentTime

private long currentTime
The current time snapshots


timerThread

TimerThread timerThread

notificationThread

private NotificationThread notificationThread

running

volatile boolean running
This flag indicates that MC is running


workToDo

private boolean workToDo
This flag indicates that MC has work to do


requestRenderWorkToDo

private boolean requestRenderWorkToDo
This flag indicates that there is work for requestRenderer


threadPending

private int threadPending
The number of THREAD_DONE messages pending


renderPending

private int renderPending

statePending

private int statePending

renderWaiting

private boolean renderWaiting
State variables for work lists


stateWaiting

private boolean stateWaiting

state

private int state
The current state of the MC thread


sleepTime

private long sleepTime

cpuLimit

private int cpuLimit
The number of cpu's Java 3D may use


mirrorObjects

private UnorderList mirrorObjects
A list of mirror objects to be updated


renderingAttributesStructure

private RenderingAttributesStructure renderingAttributesStructure
The renderingAttributesStructure for updating node component objects


defaultRenderMethod

private DefaultRenderMethod defaultRenderMethod
The default rendering method


text3DRenderMethod

private Text3DRenderMethod text3DRenderMethod
The text3D rendering method


vertexArrayRenderMethod

private VertexArrayRenderMethod vertexArrayRenderMethod
The vertex array rendering method


displayListRenderMethod

private DisplayListRenderMethod displayListRenderMethod
The displayList rendering method


compressedGeometryRenderMethod

private CompressedGeometryRenderMethod compressedGeometryRenderMethod
The compressed geometry rendering method


orientedShape3DRenderMethod

private OrientedShape3DRenderMethod orientedShape3DRenderMethod
The oriented shape3D rendering method


systemStartTime

static long systemStartTime
This is the start time upon which alpha's and behaviors are synchronized to. It is initialized once, the first time that a MasterControl object is created.


isWindowsOs

private static boolean isWindowsOs

isMacOs

private static boolean isMacOs

textureIdCount

private int textureIdCount

textureIdLock

private java.lang.Object textureIdLock

contextTimeStamp

private long contextTimeStamp

canvasIds

private boolean[] canvasIds

canvasFreeIndex

private int canvasFreeIndex

canvasIdLock

private java.lang.Object canvasIdLock

rendererCount

private int rendererCount

isSharedCtx

boolean isSharedCtx

useCombiners

boolean useCombiners

disableCompile

boolean disableCompile

doCompaction

boolean doCompaction

disableSeparateSpecularColor

boolean disableSeparateSpecularColor

isDisplayList

boolean isDisplayList

buildDisplayListIfPossible

boolean buildDisplayListIfPossible

vertexAttrsInDisplayList

boolean vertexAttrsInDisplayList

allowSoleUser

boolean allowSoleUser

allowNullGraphicsConfig

boolean allowNullGraphicsConfig

stencilClear

boolean stencilClear

globalShadingLanguage

static int globalShadingLanguage

cgLibraryAvailable

static boolean cgLibraryAvailable

glslLibraryAvailable

static boolean glslLibraryAvailable

REMOVEALLCTXS_CLEANUP

static java.lang.Integer REMOVEALLCTXS_CLEANUP

REMOVECTX_CLEANUP

static java.lang.Integer REMOVECTX_CLEANUP

REMOVENOTIFY_CLEANUP

static java.lang.Integer REMOVENOTIFY_CLEANUP

RESETCANVAS_CLEANUP

static java.lang.Integer RESETCANVAS_CLEANUP

FREECONTEXT_CLEANUP

static java.lang.Integer FREECONTEXT_CLEANUP

rendererCleanupArgs

java.lang.Object[] rendererCleanupArgs

contextCreationLock

java.lang.Object contextCreationLock

doDsiRenderLock

boolean doDsiRenderLock

enforcePowerOfTwo

boolean enforcePowerOfTwo

sharedStereoZBuffer

boolean sharedStereoZBuffer

implicitAntialiasing

boolean implicitAntialiasing

isCompiledVertexArray

boolean isCompiledVertexArray

glslVertexAttrOffset

int glslVertexAttrOffset

deviceScreenMap

java.util.Hashtable deviceScreenMap

requestObjList

UnorderList requestObjList

requestTypeList

private UnorderList requestTypeList

tempViewList

private UnorderList tempViewList

renderOnceList

private UnorderList renderOnceList

pendingRequest

private boolean pendingRequest

rootThreadGroup

private static java.lang.ThreadGroup rootThreadGroup

threadPriority

private static int threadPriority

mcThreadLock

private static java.lang.Object mcThreadLock

timestampUpdateList

private java.util.ArrayList timestampUpdateList

freeMessageList

private UnorderList freeMessageList

awt

long awt

maxLights

int maxLights

resendTexTimestamp

int resendTexTimestamp

xineramaDisabled

boolean xineramaDisabled

sortShape3DBounds

boolean sortShape3DBounds

forceReleaseView

boolean forceReleaseView

cacheAutoComputedBounds

boolean cacheAutoComputedBounds

useBoxForGroupBounds

boolean useBoxForGroupBounds

mtype

static java.lang.String[] mtype

frameCount

int frameCount

frameCountCutoff

private int frameCountCutoff

statTimes

private long[] statTimes

statCounts

private int[] statCounts

statSeen

private boolean[] statSeen

frameCycleTick

private int frameCycleTick

frameCycleNumber

private long frameCycleNumber
Constructor Detail

MasterControl

MasterControl()
Constructs a new MasterControl object. Note that there is exatly one MasterControl object, created statically by VirtualUniverse.

Method Detail

initLogger

private static boolean initLogger(java.util.logging.Logger logger,
                                  java.util.logging.Level defaultLevel)

initLoggers

private static void initLoggers()

getDevLogger

static java.util.logging.Logger getDevLogger()
Get the developer logger -- OFF by default WARNING - for probable incorrect or inconsistent api usage INFO - for informational messages such as performance hints (less verbose than FINE) FINE - for informational messages from inner loops FINER - using default values which may not be optimal


isDevLoggable

static boolean isDevLoggable(java.util.logging.Level level)

getStatsLogger

static java.util.logging.Logger getStatsLogger()
Get the stats logger -- OFF by default WARNING - statistical anomalies INFO - basic performance stats - not too verbose and minimally intrusive FINE - somewhat verbose and intrusive FINER - more verbose and intrusive FINEST - most verbose and intrusive


isStatsLoggable

static boolean isStatsLoggable(java.util.logging.Level level)

getCoreLogger

static java.util.logging.Logger getCoreLogger()
Get the core logger -- level is INFO by default SEVERE - Serious internal errors WARNING - Possible internal errors or anomalies INFO - General informational messages FINE - Internal debugging information - somewhat verbose FINER - Internal debugging information - more verbose FINEST - Internal debugging information - most verbose


isCoreLoggable

static boolean isCoreLoggable(java.util.logging.Level level)

getProperty

private static java.lang.String getProperty(java.lang.String prop)

getBooleanProperty

static boolean getBooleanProperty(java.lang.String prop,
                                  boolean defaultValue,
                                  java.lang.String trueMsg,
                                  java.lang.String falseMsg)

getBooleanProperty

static boolean getBooleanProperty(java.lang.String prop,
                                  boolean defaultValue,
                                  java.lang.String msg)

loadLibraries

static void loadLibraries()
Method to create and initialize the rendering Pipeline object, and to load the native libraries needed by Java 3D. This is called by the static initializer in VirtualUniverse before the MasterControl object is created.


getInputDeviceBlockingThread

InputDeviceBlockingThread getInputDeviceBlockingThread(InputDevice device)
Invoke from InputDeviceScheduler to create an InputDeviceBlockingThread.


setThreadPriority

void setThreadPriority(int pri)
Set thread priority to all threads under Java3D thread group.


getThreadPriority

int getThreadPriority()
Return Java3D thread priority


getRendererBit

int getRendererBit()
This returns the a unused renderer bit


getRendererId

int getRendererId()
This returns the a unused renderer bit


getContextTimeStamp

long getContextTimeStamp()
This returns a context creation time stamp Note: this has to be called under the contextCreationLock


getDisplayListId

java.lang.Integer getDisplayListId()
This returns the a unused displayListId


freeDisplayListId

void freeDisplayListId(java.lang.Integer id)

getTexture2DId

int getTexture2DId()
This returns the a unused textureId


getTexture3DId

int getTexture3DId()

freeTexture2DId

void freeTexture2DId(int id)

freeTexture3DId

void freeTexture3DId(int id)

getCanvasId

int getCanvasId()

freeCanvasId

void freeCanvasId(int canvasId)

createRenderer

private Renderer createRenderer(java.awt.GraphicsConfiguration gc)
Create a Renderer if it is not already done so. This is used for GraphicsConfigTemplate3D passing graphics call to RequestRenderer, and for creating an off-screen buffer for an off-screen Canvas3D.


postRequest

void postRequest(java.lang.Integer type,
                 java.lang.Object obj)
Post the request in queue


mcThreadDone

boolean mcThreadDone()
This procedure is invoked when isRunning is false. Return true when there is no more pending request so that Thread can terminate. Otherwise we have to recreate the MC related threads.


isD3D

final boolean isD3D()
Returns whether we are using D3D. TODO: most code that cares about this should move into the pipeline


isWindows

static final boolean isWindows()
Returns whether we are running on Windows TODO: most code that cares about this should move into the pipeline


isAppletLauncher

static boolean isAppletLauncher()
Returns a flag indicating whether the sun.jnlp.applet.launcher system property is set to true.


getTime

final long getTime()
This method increments and returns the next time value timeLock must get before this procedure is invoked


processMessage

void processMessage(J3dMessage message)
This takes a given message and parses it out to the structures and marks its time value.


processMessage

void processMessage(J3dMessage[] messages)
This takes an array of messages and parses them out to the structures and marks the time value. Make sure, setWork() is done at the very end to make sure all the messages will be processed in the same frame


sendNotification

void sendNotification(J3dNotification notification)
This takes the specified notification message and sends it to the notification thread for processing.


createMasterControlThread

void createMasterControlThread()
Create and start the MasterControl Thread.


sendMessage

void sendMessage(J3dMessage message)
Send a message to another Java 3D thread.


sendRunMessage

void sendRunMessage(int targetThreads)
Send a message to another Java 3D thread. This variant is only call by TimerThread for Input Device Scheduler or to redraw all View for RenderThread


sendRunMessage

void sendRunMessage(long waitTime,
                    View view,
                    int targetThreads)
Send a message to another Java 3D thread. This variant is only call by TimerThread for Sound Scheduler


sendRunMessage

void sendRunMessage(View v,
                    int targetThreads)
Send a message to another Java 3D thread. This variant is only called to update Render Thread


sendRunMessage

void sendRunMessage(VirtualUniverse u,
                    int targetThreads)
This sends a run message to the given threads.


cloneView

UnorderList cloneView()
Return a clone of View, we can't access individual element of View after getting the size in separate API call without synchronized views.


isRegistered

boolean isRegistered(View view)
Return true if view is already registered with MC


updateTimeValues

private void updateTimeValues()
This snapshots the time values to be used for this iteration. Note that this method is called without the timeLock held. We must synchronize on timeLock to prevent updating thread.lastUpdateTime from user thread in sendMessage() or sendRunMessage().


createUpdateThread

private void createUpdateThread(J3dStructure structure)

emptyMessageList

private void emptyMessageList(J3dStructure structure,
                              View v)

destroyUpdateThread

private void destroyUpdateThread(J3dStructure structure)

registerView

private void registerView(View v)
This register a View with MasterControl. The View has at least one Canvas3D added to a container.


unregisterView

private void unregisterView(View v)
This unregister a View with MasterControl. The View no longer has any Canvas3Ds in a container.


createMCThreads

void createMCThreads()
This procedure create MC thread that start together with MC.


destroyUniverseThreads

private void destroyUniverseThreads(VirtualUniverse univ)
Destroy all VirtualUniverse related threads. This procedure may call two times when Locale detach in a live viewPlatform.


evaluateAllCanvases

private void evaluateAllCanvases()
Note that we have to go through all views instead of evaluate only the canvas in a single view since each screen may share by multiple view


evaluatePhysicalEnv

private void evaluatePhysicalEnv(View v)

addToStateThreads

private final void addToStateThreads(J3dThreadData threadData)

assignNewPrimaryView

private void assignNewPrimaryView(VirtualUniverse univ)

getDefaultRenderMethod

RenderMethod getDefaultRenderMethod()
This returns the default RenderMethod


getText3DRenderMethod

RenderMethod getText3DRenderMethod()
This returns the text3d RenderMethod


getVertexArrayRenderMethod

RenderMethod getVertexArrayRenderMethod()
This returns the vertexArray RenderMethod


getDisplayListRenderMethod

RenderMethod getDisplayListRenderMethod()
This returns the displayList RenderMethod


getCompressedGeometryRenderMethod

RenderMethod getCompressedGeometryRenderMethod()
This returns the compressed geometry RenderMethod


getOrientedShape3DRenderMethod

RenderMethod getOrientedShape3DRenderMethod()
This returns the oriented shape3d RenderMethod


viewActivate

private void viewActivate(View v)
This notifies MasterControl that the given view has been activated


freeContext

private void freeContext(View v)
Release context associate with view


viewDeactivate

private void viewDeactivate(View v)
This notifies MasterControl that the given view has been deactivated


startView

private void startView(View v)
This notifies MasterControl to start given view


stopView

private void stopView(View v)
This notifies MasterControl to stop given view


addInputDeviceScheduler

void addInputDeviceScheduler(InputDeviceScheduler ds)

removeInputDeviceScheduler

void removeInputDeviceScheduler(InputDeviceScheduler ds)

addMirrorObject

void addMirrorObject(ObjectUpdate o)
Add an object to the mirror object list


updateMirrorObjects

void updateMirrorObjects()
This updates any mirror objects. It is called when threads are done.


updateWorkThreads

private void updateWorkThreads()
This fun little method does all the hard work of setting up the work thread list.


dumpWorkThreads

void dumpWorkThreads()

setWork

final void setWork()
A convienence wrapper function for various parts of the system to force MC to run.


setWorkForRequestRenderer

final void setWorkForRequestRenderer()

sendRenderMessage

void sendRenderMessage(java.awt.GraphicsConfiguration gc,
                       java.lang.Object arg,
                       java.lang.Integer mtype)
Call from GraphicsConfigTemplate to evaluate current capabilities using Renderer thread to invoke native graphics library functions. This avoid MT-safe problem when using thread directly invoke graphics functions.


sendDestroyCtxAndOffScreenBuffer

void sendDestroyCtxAndOffScreenBuffer(Canvas3D c)

sendCreateOffScreenBuffer

void sendCreateOffScreenBuffer(Canvas3D c)

sendAllocateCanvasId

void sendAllocateCanvasId(Canvas3D c)

sendFreeCanvasId

void sendFreeCanvasId(Canvas3D c)

doWork

void doWork()
This is the MasterControl work method for Java 3D


handlePendingRequest

private void handlePendingRequest()

clearRenderOnceList

private void clearRenderOnceList()

runMonitor

void runMonitor(int action,
                UnorderList stateThreadList,
                UnorderList renderThreadList,
                UnorderList requestRenderThreadList,
                J3dThread nthread)

dumpThreads

private java.lang.String dumpThreads(int threads)

dumpMessage

private void dumpMessage(java.lang.String str,
                         J3dMessage m)

manageMemory

private void manageMemory()

threadYield

static final void threadYield()
Yields the current thread, by sleeping for a small amount of time. Unlike Thread.yield(), this method guarantees that the current thread will yield to another thread waiting to run. It also ensures that the other threads will run for at least a small amount of time before the current thread runs again.


getNumberOfProcessors

private int getNumberOfProcessors()

recordTime

void recordTime(MasterControl.TimeType type,
                long deltaTime)

logTimes

private void logTimes()


Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.