<commit_before>// Copyright 2014-2020, University of Colorado Boulder

/**
 * Main file for the scenery-phet library demo.
 *
 * @author <NAME>
 */

import Property from '../../axon/js/Property.js';
import Screen from '../../joist/js/Screen.js';
import ScreenIcon from '../../joist/js/ScreenIcon.js';
import Sim from '../../joist/js/Sim.js';
import simLauncher from '../../joist/js/simLauncher.js';
import Rectangle from '../../scenery/js/nodes/Rectangle.js';
import Tandem from '../../tandem/js/Tandem.js';
import ButtonsScreenView from './demo/ButtonsScreenView.js';
import ComponentsScreenView from './demo/ComponentsScreenView.js';
import DialogsScreenView from './demo/DialogsScreenView.js';
import SceneryPhetMemoryTestsScreenView from './demo/SceneryPhetMemoryTestsScreenView.js';
import SceneryPhetKeyboardHelpContent from './demo/SceneryPhetKeyboardHelpContent.js';
import SlidersScreenView from './demo/SlidersScreenView.js';
import SpringScreenView from './demo/SpringScreenView.js';
import sceneryPhetStrings from './sceneryPhetStrings.js';
import sceneryPhetQueryParameters from './sceneryPhetQueryParameters.js';

const sceneryPhetTitleString = sceneryPhetStrings[ 'scenery-phet' ].title;

const MODEL = {};

const simOptions = {
  credits: {
    leadDesign: 'PhET'
  },
  keyboardHelpNode: new SceneryPhetKeyboardHelpContent(),
  webgl: true
};

// Creates a rectangle filled with a specified color
const createScreenIcon = function( color ) {
  return new ScreenIcon(
    new Rectangle( 0, 0, Screen.MINIMUM_HOME_SCREEN_ICON_SIZE.width, Screen.MINIMUM_HOME_SCREEN_ICON_SIZE.height, {
      fill: color
    } )
  );
};

// Create and start sim
simLauncher.launch( function() {

  const buttonsScreenTandem = Tandem.ROOT.createTandem( 'buttonsScreen' );
  const slidersScreenTandem = Tandem.ROOT.createTandem( 'slidersScreen' );
  const componentsScreenTandem = Tandem.ROOT.createTandem( 'componentsScreen' );
  const dialogsScreenTandem = Tandem.ROOT.createTandem( 'dialogsScreen' );
  const springScreenTandem = Tandem.ROOT.createTandem( 'springsScreen' );
  const memoryTestsScreenTandem = Tandem.ROOT.createTandem( 'memoryTestsScreen' );
  new Sim( sceneryPhetTitleString, [

    // Buttons
    new Screen(
      () => MODEL,
      () => new ButtonsScreenView(),
      {
        name: 'Buttons',
        backgroundColorProperty: new Property( sceneryPhetQueryParameters.backgroundColor ),
        homeScreenIcon: createScreenIcon( 'red' ),
        tandem: buttonsScreenTandem
      }
    ),

    // Sliders
    new Screen(
      () => MODEL,
      () => new SlidersScreenView(),
      {
        name: 'Sliders',
        backgroundColorProperty: new Property( sceneryPhetQueryParameters.backgroundColor ),
        homeScreenIcon: createScreenIcon( 'yellow' ),
        tandem: slidersScreenTandem
      }
    ),

      // Components
      new Screen(
        () => MODEL,
        () => new ComponentsScreenView( { tandem: componentsScreenTandem.createTandem( 'view' ) } ),
        {
          name: 'Components',
          backgroundColorProperty: new Property( sceneryPhetQueryParameters.backgroundColor ),
          homeScreenIcon: createScreenIcon( 'orange' ),
          tandem: componentsScreenTandem
        }
      ),

      // Dialogs
      new Screen(
        () => MODEL,
        () => new DialogsScreenView(),
        {
          name: 'Dialogs',
          backgroundColorProperty: new Property( sceneryPhetQueryParameters.backgroundColor ),
          homeScreenIcon: createScreenIcon( 'maroon' ),
          tandem: dialogsScreenTandem
        }
      ),

      // Spring
      new Screen(
        () => MODEL,
        () => new SpringScreenView(),
        {
          name: 'Spring',
          backgroundColorProperty: new Property( sceneryPhetQueryParameters.backgroundColor ),
          homeScreenIcon: createScreenIcon( 'blue' ),
          tandem: springScreenTandem
        }
      ),

      // Memory Tests
      new Screen(
        () => MODEL,
        () => new SceneryPhetMemoryTestsScreenView(),
        {
          name: 'Memory Tests',
          backgroundColorProperty: new Property( sceneryPhetQueryParameters.backgroundColor ),
          homeScreenIcon: createScreenIcon( 'purple' ),
          tandem: memoryTestsScreenTandem
        }
      )
    ], simOptions ).start();
} );<commit_msg>more cleanup of sun and scenery-phet demos, https://github.com/phetsims/tasks/issues/1044<commit_after>// Copyright 2014-2020, University of Colorado Boulder

/**
 * Main file for the scenery-phet library demo.
 *
 * @author <NAME>
 */

import Property from '../../axon/js/Property.js';
import Screen from '../../joist/js/Screen.js';
import ScreenIcon from '../../joist/js/ScreenIcon.js';
import Sim from '../../joist/js/Sim.js';
import simLauncher from '../../joist/js/simLauncher.js';
import Rectangle from '../../scenery/js/nodes/Rectangle.js';
import Tandem from '../../tandem/js/Tandem.js';
import ButtonsScreenView from './demo/ButtonsScreenView.js';
import ComponentsScreenView from './demo/ComponentsScreenView.js';
import DialogsScreenView from './demo/DialogsScreenView.js';
import SceneryPhetMemoryTestsScreenView from './demo/SceneryPhetMemoryTestsScreenView.js';
import SceneryPhetKeyboardHelpContent from './demo/SceneryPhetKeyboardHelpContent.js';
import SlidersScreenView from './demo/SlidersScreenView.js';
import SpringScreenView from './demo/SpringScreenView.js';
import sceneryPhetStrings from './sceneryPhetStrings.js';
import sceneryPhetQueryParameters from './sceneryPhetQueryParameters.js';

// empty model used for all demo screens
const MODEL = {};

const simOptions = {
  credits: {
    leadDesign: 'PhET'
  },
  keyboardHelpNode: new SceneryPhetKeyboardHelpContent(),
  webgl: true
};

/**
 * Creates a simple screen icon, a colored rectangle.
 * @param {ColorDef} color
 * @returns {ScreenIcon}
 */
function createScreenIcon( color ) {
  return new ScreenIcon(
    new Rectangle( 0, 0, Screen.MINIMUM_HOME_SCREEN_ICON_SIZE.width, Screen.MINIMUM_HOME_SCREEN_ICON_SIZE.height, {
      fill: color
    } )
  );
}

// Create and start sim
simLauncher.launch( () => {

  const componentsScreenTandem = Tandem.ROOT.createTandem( 'componentsScreen' );

  new Sim( sceneryPhetStrings[ 'scenery-phet' ].title, [

    // Buttons
    new Screen(
      () => MODEL,
      () => new ButtonsScreenView(),
      {
        name: 'Buttons',
        backgroundColorProperty: new Property( sceneryPhetQueryParameters.backgroundColor ),
        homeScreenIcon: createScreenIcon( 'red' ),
        tandem: Tandem.ROOT.createTandem( 'buttonsScreen' )
      }
    ),

    // Sliders
    new Screen(
      () => MODEL,
      () => new SlidersScreenView(),
      {
        name: 'Sliders',
        backgroundColorProperty: new Property( sceneryPhetQueryParameters.backgroundColor ),
        homeScreenIcon: createScreenIcon( 'yellow' ),
        tandem: Tandem.ROOT.createTandem( 'slidersScreen' )
      }
    ),

    // Components
    new Screen(
      () => MODEL,
      () => new ComponentsScreenView( { tandem: componentsScreenTandem.createTandem( 'view' ) } ),
      {
        name: 'Components',
        backgroundColorProperty: new Property( sceneryPhetQueryParameters.backgroundColor ),
        homeScreenIcon: createScreenIcon( 'orange' ),
        tandem: componentsScreenTandem
      }
    ),

    // Dialogs
    new Screen(
      () => MODEL,
      () => new DialogsScreenView(),
      {
        name: 'Dialogs',
        backgroundColorProperty: new Property( sceneryPhetQueryParameters.backgroundColor ),
        homeScreenIcon: createScreenIcon( 'maroon' ),
        tandem: Tandem.ROOT.createTandem( 'dialogsScreen' )
      }
    ),

    // Spring
    new Screen(
      () => MODEL,
      () => new SpringScreenView(),
      {
        name: 'Spring',
        backgroundColorProperty: new Property( sceneryPhetQueryParameters.backgroundColor ),
        homeScreenIcon: createScreenIcon( 'blue' ),
        tandem: Tandem.ROOT.createTandem( 'springsScreen' )
      }
    ),

    // Memory Tests
    new Screen(
      () => MODEL,
      () => new SceneryPhetMemoryTestsScreenView(),
      {
        name: 'Memory Tests',
        backgroundColorProperty: new Property( sceneryPhetQueryParameters.backgroundColor ),
        homeScreenIcon: createScreenIcon( 'purple' ),
        tandem: Tandem.ROOT.createTandem( 'memoryTestsScreen' )
      }
    )
  ], simOptions ).start();
} );
{'fraction_non_alphanumeric': 0.12116892373485388, 'fraction_numerical': 0.002851033499643621, 'mean_word_length': 3.076997578692494, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 30, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1037450', 'n_tokens_mistral': 2551, 'n_tokens_neox': 2426, 'n_words': 523}