src/layer/FrameStatisticsLayer.js
function (worldWindow) {
            if (!worldWindow) {
                throw new ArgumentError(
                    Logger.logMessage(Logger.LEVEL_SEVERE, "FrameStatisticsLayer", "constructor", "missingWorldWindow"));
            }

            Layer.call(this, "Frame Statistics");

            // No picking of this layer's screen elements.
            this.pickEnabled = false;

            var textAttributes = new TextAttributes(null);
            textAttributes.color = Color.GREEN;
            textAttributes.font = new Font(12);
            textAttributes.offset = new Offset(WorldWind.OFFSET_FRACTION, 0, WorldWind.OFFSET_FRACTION, 1);

            // Intentionally not documented.
            this.frameTime = new ScreenText(new Offset(WorldWind.OFFSET_PIXELS, 5, WorldWind.OFFSET_INSET_PIXELS, 5), " ");
            this.frameTime.attributes = textAttributes;

            // Intentionally not documented.
            this.frameRate = new ScreenText(new Offset(WorldWind.OFFSET_PIXELS, 5, WorldWind.OFFSET_INSET_PIXELS, 25), " ");
            this.frameRate.attributes = textAttributes;

            // Register a redraw callback on the WorldWindow.
            var thisLayer = this;

            function redrawCallback(worldWindow, stage) {
                thisLayer.handleRedraw(worldWindow, stage);
            }

            worldWindow.redrawCallbacks.push(redrawCallback);
        }
function (worldWindow) {
            if (!worldWindow) {
                throw new ArgumentError(
                    Logger.logMessage(Logger.LEVEL_SEVERE, "FrameStatisticsLayer", "constructor", "missingWorldWindow"));
            }

            Layer.call(this, "Frame Statistics");

            // No picking of this layer's screen elements.
            this.pickEnabled = false;

            var textAttributes = new TextAttributes(null);
            textAttributes.color = Color.GREEN;
            textAttributes.font = new Font(12);
            textAttributes.offset = new Offset(WorldWind.OFFSET_FRACTION, 0, WorldWind.OFFSET_FRACTION, 1);

            // Intentionally not documented.
            this.frameTime = new ScreenText(new Offset(WorldWind.OFFSET_PIXELS, 5, WorldWind.OFFSET_INSET_PIXELS, 5), " ");
            this.frameTime.attributes = textAttributes;

            // Intentionally not documented.
            this.frameRate = new ScreenText(new Offset(WorldWind.OFFSET_PIXELS, 5, WorldWind.OFFSET_INSET_PIXELS, 25), " ");
            this.frameRate.attributes = textAttributes;

            // Register a redraw callback on the WorldWindow.
            var thisLayer = this;

            function redrawCallback(worldWindow, stage) {
                thisLayer.handleRedraw(worldWindow, stage);
            }

            worldWindow.redrawCallbacks.push(redrawCallback);
        }
function ( worldWindow ) { if ( ! worldWindow ) { throw new ArgumentError ( Logger . logMessage ( Logger . LEVEL_SEVERE , "FrameStatisticsLayer" , "constructor" , "missingWorldWindow" ) ) ; } Layer . call ( this , "Frame Statistics" ) ; // No picking of this layer's screen elements. this . pickEnabled = false ; var textAttributes = new TextAttributes ( null ) ; textAttributes . color = Color . GREEN ; textAttributes . font = new Font ( 12 ) ; textAttributes . offset = new Offset ( WorldWind . OFFSET_FRACTION , 0 , WorldWind . OFFSET_FRACTION , 1 ) ; // Intentionally not documented. this . frameTime = new ScreenText ( new Offset ( WorldWind . OFFSET_PIXELS , 5 , WorldWind . OFFSET_INSET_PIXELS , 5 ) , " " ) ; this . frameTime . attributes = textAttributes ; // Intentionally not documented. this . frameRate = new ScreenText ( new Offset ( WorldWind . OFFSET_PIXELS , 5 , WorldWind . OFFSET_INSET_PIXELS , 25 ) , " " ) ; this . frameRate . attributes = textAttributes ; // Register a redraw callback on the WorldWindow. var thisLayer = this ; function redrawCallback ( worldWindow , stage ) { thisLayer . handleRedraw ( worldWindow , stage ) ; } worldWindow . redrawCallbacks . push ( redrawCallback ) ; }
Constructs a layer that displays the current performance statistics.
@alias FrameStatisticsLayer
@constructor
@augments Layer
@classDesc Displays the current performance statistics, which are collected each frame in the WorldWindow's
{@link FrameStatistics}. A frame statics layer cannot be shared among WorldWindows. Each WorldWindow if it
is to have a frame statistics layer must have its own.
@param {WorldWindow} worldWindow The WorldWindow associated with this layer.
This layer may not be associated with more than one WorldWindow. Each WorldWindow must have it's own
instance of this layer if each window is to have a frame statistics display.
@throws {ArgumentError} If the specified WorldWindow is null or undefined.
Constructs a layer that displays the current performance statistics .