// Copyright 2002-2014, University of Colorado Boulder /** * This class defines a separate window that shows a representation of the Compost Data. * */ define( function( require ) { 'use strict'; // general modules var inherit = require( 'PHET_CORE/inherit' ); var PropertySet = require( 'AXON/PropertySet' ); var PhetFont = require( 'SCENERY_PHET/PhetFont' ); var Text = require( 'SCENERY/nodes/Text' ); var Plane = require( 'SCENERY/nodes/Plane' ); var TextPushButton = require( 'SUN/buttons/TextPushButton' ); //specific modules var Dialog = require('COMPOST/cnratio/view/Dialog'); function DataWindow( CompostScreenView , options) { options = _.extend( { buttonX:100, buttonY:100, }, options ); var thisWindow = this; var layoutBounds = CompostScreenView.layoutBounds; var dialog= new Dialog(); var fontOptions = {font: new PhetFont( { fill: 'black', size: 14 } )}; var showAboutDialog = function( dialog ) { var plane = new Plane( {fill: 'black', opacity: 0.3, renderer: 'svg'} ); CompostScreenView.addChild( plane ); CompostScreenView.addChild( dialog ); dialog.centerX = layoutBounds.centerX; dialog.centerY = layoutBounds.centerY; var dialogListener = {up: function() { dialog.removeInputListener( dialogListener ); plane.addInputListener( dialogListener ); dialog.detach(); plane.detach(); }}; dialog.addInputListener( dialogListener ); plane.addInputListener( dialogListener ); }; var showDataButton = new TextPushButton ( 'Materials Information', { baseColor: 'rgb(98, 173, 205)', font: new PhetFont( 16 ), textFill: 'black', xMargin: 10, listener: function() { showAboutDialog(dialog);}, } ); CompostScreenView.addChild(showDataButton); showDataButton.centerY = options.buttonY; showDataButton.centerX = options.buttonX; } return inherit( Object, DataWindow); } );