diff --git a/balloons-and-static-electricity_a11y_view.html b/balloons-and-static-electricity_a11y_view.html index 52613184..cf4f7308 100644 --- a/balloons-and-static-electricity_a11y_view.html +++ b/balloons-and-static-electricity_a11y_view.html @@ -269,7 +269,7 @@

PDOM & Descriptions for Balloons and Static Electricity

var PDOMCopy = PDOMRoot.cloneNode( true ); // get the alert dom elements from the iframe's inner document - var ariaLiveElementsContainer = innerWindow.phet.joist.sim.display.utteranceQueue.getAriaLiveContainer(); + var ariaLiveElementsContainer = innerWindow.phet.joist.sim.utteranceQueue.getAriaLiveContainer(); // get the alert dom elements from the PDOM copy var alertList = document.getElementById( 'alert-list' ); diff --git a/js/balloons-and-static-electricity/view/BalloonNode.js b/js/balloons-and-static-electricity/view/BalloonNode.js index 5a402d4b..b4993c9b 100644 --- a/js/balloons-and-static-electricity/view/BalloonNode.js +++ b/js/balloons-and-static-electricity/view/BalloonNode.js @@ -234,7 +234,7 @@ define( require => { if ( self.attemptToMoveBeyondBoundary( event.domEvent.keyCode ) ) { const attemptedDirection = self.getAttemptedMovementDirection( event.domEvent.keyCode ); boundaryUtterance.alert = self.describer.movementDescriber.getTouchingBoundaryDescription( attemptedDirection ); - phet.joist.sim.display.utteranceQueue.addToBack( boundaryUtterance ); + phet.joist.sim.utteranceQueue.addToBack( boundaryUtterance ); } } } ); @@ -350,11 +350,11 @@ define( require => { this.model.setCenter( center ); // clear the queue of utterances that collected as position changed - phet.joist.sim.display.utteranceQueue.clear(); + phet.joist.sim.utteranceQueue.clear(); // Send a custom alert, depending on where the balloon was moved to this.jumpingUtterance.alert = this.describer.movementDescriber.getJumpingDescription( center ); - phet.joist.sim.display.utteranceQueue.addToBack( this.jumpingUtterance ); + phet.joist.sim.utteranceQueue.addToBack( this.jumpingUtterance ); // reset forces in tracked values in describer that determine description for induced charge change this.describer.chargeDescriber.resetReferenceForces(); diff --git a/js/balloons-and-static-electricity/view/ControlPanel.js b/js/balloons-and-static-electricity/view/ControlPanel.js index be14b751..14dbe481 100644 --- a/js/balloons-and-static-electricity/view/ControlPanel.js +++ b/js/balloons-and-static-electricity/view/ControlPanel.js @@ -109,7 +109,7 @@ const VBox = require( 'SCENERY/nodes/VBox' ); self.wallButton.innerContent = model.wall.isVisibleProperty.get() ? removeWallString : addWallString; const alertDescription = wallVisible ? wallAddedString : wallRemovedString; - phet.joist.sim.display.utteranceQueue.addToBack( alertDescription ); + phet.joist.sim.utteranceQueue.addToBack( alertDescription ); } ); // Radio buttons related to charges @@ -167,7 +167,7 @@ const VBox = require( 'SCENERY/nodes/VBox' ); } assert && assert( alertString, 'no interactive alert for showChargesProperty value ' + value ); - phet.joist.sim.display.utteranceQueue.addToBack( alertString ); + phet.joist.sim.utteranceQueue.addToBack( alertString ); } ); // Radio buttons for selecting 1 vs 2 balloons @@ -227,17 +227,17 @@ const VBox = require( 'SCENERY/nodes/VBox' ); const resetBalloonButtonListener = function() { // disable other alerts until after we are finished resetting the balloons - phet.joist.sim.display.utteranceQueue.enabled = false; + phet.joist.sim.utteranceQueue.enabled = false; model.sweater.reset(); model.balloons.forEach( function( balloon ) { balloon.reset( true ); } ); - phet.joist.sim.display.utteranceQueue.enabled = true; + phet.joist.sim.utteranceQueue.enabled = true; // alert to assistive technology - phet.joist.sim.display.utteranceQueue.addToBack( StringUtils.fillIn( resetBalloonsAlertPatternString, { + phet.joist.sim.utteranceQueue.addToBack( StringUtils.fillIn( resetBalloonsAlertPatternString, { balloons: model.greenBalloon.isVisibleProperty.get() ? balloonsString : balloonString } ) ); }; diff --git a/js/balloons-and-static-electricity/view/describers/BalloonDescriber.js b/js/balloons-and-static-electricity/view/describers/BalloonDescriber.js index b76ec5a9..eeb65759 100644 --- a/js/balloons-and-static-electricity/view/describers/BalloonDescriber.js +++ b/js/balloons-and-static-electricity/view/describers/BalloonDescriber.js @@ -173,13 +173,13 @@ const Vector2 = require( 'DOT/Vector2' ); // the first charge pickup and subsequent pickups (behind a refresh rate) should be announced if ( self.alertNextPickup || self.alertFirstPickup ) { alert = self.getChargePickupDescription( self.alertFirstPickup ); - phet.joist.sim.display.utteranceQueue.addToBack( alert ); + phet.joist.sim.utteranceQueue.addToBack( alert ); } // announce pickup of last charge, as long as charges are visible if ( Math.abs( chargeVal ) === BASEConstants.MAX_BALLOON_CHARGE && self.showChargesProperty.get() !== 'none' ) { alert = self.getLastChargePickupDescription(); - phet.joist.sim.display.utteranceQueue.addToBack( alert ); + phet.joist.sim.utteranceQueue.addToBack( alert ); } // reset flags @@ -190,7 +190,7 @@ const Vector2 = require( 'DOT/Vector2' ); // when visibility changes, generate the alert and be sure to describe initial movement the next time the // balloon is released or added to the play area balloon.isVisibleProperty.lazyLink( function( isVisible ) { - phet.joist.sim.display.utteranceQueue.addToBack( self.getVisibilityChangedDescription() ); + phet.joist.sim.utteranceQueue.addToBack( self.getVisibilityChangedDescription() ); self.initialMovementDescribed = false; self.preventNoMovementAlert = true; } ); @@ -198,7 +198,7 @@ const Vector2 = require( 'DOT/Vector2' ); // a11y - if we enter/leave the sweater announce that immediately balloon.onSweaterProperty.link( function( onSweater ) { if ( balloon.isDraggedProperty.get() ) { - phet.joist.sim.display.utteranceQueue.addToBack( self.movementDescriber.getOnSweaterString( onSweater ) ); + phet.joist.sim.utteranceQueue.addToBack( self.movementDescriber.getOnSweaterString( onSweater ) ); } // entering sweater, indicate that we need to alert the next charge pickup @@ -211,7 +211,7 @@ const Vector2 = require( 'DOT/Vector2' ); if ( !self.balloonModel.jumping ) { if ( self.describeDirection ) { self.directionUtterance.alert = self.movementDescriber.getDirectionChangedDescription(); - phet.joist.sim.display.utteranceQueue.addToBack( self.directionUtterance ); + phet.joist.sim.utteranceQueue.addToBack( self.directionUtterance ); } } } ); @@ -712,13 +712,13 @@ const Vector2 = require( 'DOT/Vector2' ); if ( model.onSweater() || model.touchingWall() ) { // while dragging, just attractive state and location - phet.joist.sim.display.utteranceQueue.addToBack( this.movementDescriber.getAttractiveStateAndLocationDescriptionWithLabel() ); + phet.joist.sim.utteranceQueue.addToBack( this.movementDescriber.getAttractiveStateAndLocationDescriptionWithLabel() ); } } else if ( model.onSweater() ) { // if we stop on the sweater, announce that we are sticking to it - phet.joist.sim.display.utteranceQueue.addToBack( this.movementDescriber.getAttractiveStateAndLocationDescriptionWithLabel() ); + phet.joist.sim.utteranceQueue.addToBack( this.movementDescriber.getAttractiveStateAndLocationDescriptionWithLabel() ); } else { @@ -726,7 +726,7 @@ const Vector2 = require( 'DOT/Vector2' ); // special case: if the balloon is touching the wall for the first time, don't describe this because // the section of this function observing that state will describe this if ( nextTouchingWall === this.describedTouchingWall ) { - phet.joist.sim.display.utteranceQueue.addToBack( this.movementDescriber.getMovementStopsDescription() ); + phet.joist.sim.utteranceQueue.addToBack( this.movementDescriber.getMovementStopsDescription() ); } } } @@ -777,7 +777,7 @@ const Vector2 = require( 'DOT/Vector2' ); // assign an id so that we only announce the most recent alert in the utteranceQueue this.movementUtterance.alert = utterance; - phet.joist.sim.display.utteranceQueue.addToBack( this.movementUtterance ); + phet.joist.sim.utteranceQueue.addToBack( this.movementUtterance ); } // describe the change in induced charge due to balloon dragging @@ -796,7 +796,7 @@ const Vector2 = require( 'DOT/Vector2' ); } this.inducedChargeChangeUtterance.alert = utterance; - phet.joist.sim.display.utteranceQueue.addToBack( this.inducedChargeChangeUtterance ); + phet.joist.sim.utteranceQueue.addToBack( this.inducedChargeChangeUtterance ); } // update flags that indicate which alerts should come next @@ -819,14 +819,14 @@ const Vector2 = require( 'DOT/Vector2' ); if ( !model.jumping ) { if ( nextTouchingWall ) { if ( model.isDraggedProperty.get() && this.showChargesProperty.get() === 'all' ) { - phet.joist.sim.display.utteranceQueue.addToBack( this.getWallRubbingDescriptionWithChargePairs() ); + phet.joist.sim.utteranceQueue.addToBack( this.getWallRubbingDescriptionWithChargePairs() ); this.describeWallRub = false; } else { // generates a description of how the balloon interacts with the wall if ( nextVisible ) { - phet.joist.sim.display.utteranceQueue.addToBack( this.movementDescriber.getMovementStopsDescription() ); + phet.joist.sim.utteranceQueue.addToBack( this.movementDescriber.getMovementStopsDescription() ); } } } @@ -839,7 +839,7 @@ const Vector2 = require( 'DOT/Vector2' ); if ( nextIsDragged ) { utterance = this.movementDescriber.getGrabbedAlert(); - phet.joist.sim.display.utteranceQueue.addToBack( utterance ); + phet.joist.sim.utteranceQueue.addToBack( utterance ); // we have been picked up successfully, start describing direction this.describeDirection = true; @@ -877,7 +877,7 @@ const Vector2 = require( 'DOT/Vector2' ); if ( !nextVelocity.equals( Vector2.ZERO ) ) { utterance = this.movementDescriber.getInitialReleaseDescription(); - phet.joist.sim.display.utteranceQueue.addToBack( utterance ); + phet.joist.sim.utteranceQueue.addToBack( utterance ); // after describing initial movement, continue to describe direction changes this.describeDirection = true; @@ -888,7 +888,7 @@ const Vector2 = require( 'DOT/Vector2' ); // when the balloon is first added to the play area if ( !this.preventNoMovementAlert ) { utterance = this.movementDescriber.getNoChangeReleaseDescription(); - phet.joist.sim.display.utteranceQueue.addToBack( utterance ); + phet.joist.sim.utteranceQueue.addToBack( utterance ); } this.preventNoMovementAlert = false; } @@ -902,7 +902,7 @@ const Vector2 = require( 'DOT/Vector2' ); // if the balloon is moving slowly, alert a continuous movement description if ( this.movementDescriber.balloonMovingAtContinousDescriptionVelocity() ) { utterance = this.movementDescriber.getContinuousReleaseDescription(); - phet.joist.sim.display.utteranceQueue.addToBack( utterance ); + phet.joist.sim.utteranceQueue.addToBack( utterance ); // reset timer this.timeSinceReleaseAlert = 0; @@ -916,7 +916,7 @@ const Vector2 = require( 'DOT/Vector2' ); if ( this.rubAlertDirty ) { if ( nextIsDragged && model.onSweater() ) { this.chargeUtterance.alert = this.getNoChargePickupDescription(); - phet.joist.sim.display.utteranceQueue.addToBack( this.chargeUtterance ); + phet.joist.sim.utteranceQueue.addToBack( this.chargeUtterance ); } } }