Skip to content

Commit

Permalink
add initial support for list that describes observation window, see #374
Browse files Browse the repository at this point in the history
  • Loading branch information
jbphet committed Nov 28, 2023
1 parent cd806d8 commit 532c352
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
13 changes: 13 additions & 0 deletions js/layer-model/view/LayerModelObservationWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import AtmosphericPhotonsSoundGenerator from '../../common/view/AtmosphericPhoto
import GreenhouseEffectObservationWindow from '../../common/view/GreenhouseEffectObservationWindow.js';
import ThermometerAndReadout from '../../common/view/ThermometerAndReadout.js';
import Tandem from '../../../../tandem/js/Tandem.js';
import LayerModelObservationWindowPDOMNode from './LayerModelObservationWindowPDOMNode.js';

class LayerModelObservationWindow extends GreenhouseEffectObservationWindow {
private readonly photonsNode: PhotonSprites;
Expand Down Expand Up @@ -120,6 +121,18 @@ class LayerModelObservationWindow extends GreenhouseEffectObservationWindow {

// sound generation
soundManager.addSoundGenerator( new AtmosphericPhotonsSoundGenerator( model.photonCollection ) );

// pdom - manages descriptions for the observation window
const layerModelObservationWindowPDOMNode = new LayerModelObservationWindowPDOMNode( model );
this.addChild( layerModelObservationWindowPDOMNode );

// pdom - order of contents in the PDOM for traversal and screen readers
this.pdomOrder = [
this.focusableHeadingNode,
this.startSunlightButton,
layerModelObservationWindowPDOMNode,
this.energyBalancePanel
];
}

public override step( dt: number ): void {
Expand Down
21 changes: 21 additions & 0 deletions js/layer-model/view/LayerModelObservationWindowPDOMNode.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright 2022-2023, University of Colorado Boulder

import ObservationWindowPDOMNode from '../../common/view/ObservationWindowPDOMNode.js';
import greenhouseEffect from '../../greenhouseEffect.js';
import LayerModelModel from '../model/LayerModelModel.js';

/**
* Responsible for PDOM content related to the observation window used in the waves screen.
*
* @author John Blanco (PhET Interactive Simulations)
*/

class LayerModelObservationWindowPDOMNode extends ObservationWindowPDOMNode {

public constructor( model: LayerModelModel ) {
super( model.sunEnergySource.isShiningProperty );
}
}

greenhouseEffect.register( 'LayerModelObservationWindowPDOMNode', LayerModelObservationWindowPDOMNode );
export default LayerModelObservationWindowPDOMNode;

0 comments on commit 532c352

Please sign in to comment.