Skip to content

Commit

Permalink
Move screenViewRoot to base class, see: https://github.com/phetsims/m…
Browse files Browse the repository at this point in the history
  • Loading branch information
marlitas committed Sep 7, 2022
1 parent bb00d51 commit 6010a52
Show file tree
Hide file tree
Showing 8 changed files with 130 additions and 130 deletions.
6 changes: 3 additions & 3 deletions js/InverseSquareLawCommonStrings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ type StringsType = {
}
};

const inverseSquareLawCommonStrings = getStringModule( 'INVERSE_SQUARE_LAW_COMMON' ) as StringsType;
const InverseSquareLawCommonStrings = getStringModule( 'INVERSE_SQUARE_LAW_COMMON' ) as StringsType;

inverseSquareLawCommon.register( 'inverseSquareLawCommonStrings', inverseSquareLawCommonStrings );
inverseSquareLawCommon.register( 'InverseSquareLawCommonStrings', InverseSquareLawCommonStrings );

export default inverseSquareLawCommonStrings;
export default InverseSquareLawCommonStrings;
4 changes: 2 additions & 2 deletions js/view/ISLCAlertManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
import Alerter from '../../../scenery-phet/js/accessibility/describers/Alerter.js';
import ActivationUtterance from '../../../utterance-queue/js/ActivationUtterance.js';
import inverseSquareLawCommon from '../inverseSquareLawCommon.js';
import inverseSquareLawCommonStrings from '../inverseSquareLawCommonStrings.js';
import InverseSquareLawCommonStrings from '../InverseSquareLawCommonStrings.js';

// constants
const forceValuesHiddenString = inverseSquareLawCommonStrings.a11y.forceValuesHidden;
const forceValuesHiddenString = InverseSquareLawCommonStrings.a11y.forceValuesHidden;

class ISLCAlertManager extends Alerter {

Expand Down
6 changes: 3 additions & 3 deletions js/view/ISLCForceArrowNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ import PhetFont from '../../../scenery-phet/js/PhetFont.js';
import ScientificNotationNode from '../../../scenery-phet/js/ScientificNotationNode.js';
import { Node, ReadingBlock, Rectangle, RichText } from '../../../scenery/js/imports.js';
import inverseSquareLawCommon from '../inverseSquareLawCommon.js';
import inverseSquareLawCommonStrings from '../inverseSquareLawCommonStrings.js';
import InverseSquareLawCommonStrings from '../InverseSquareLawCommonStrings.js';
import ISLCConstants from '../ISLCConstants.js';
import DefaultDirection from './DefaultDirection.js';

const forceOnObjectByOtherObjectPatternString = inverseSquareLawCommonStrings.forceOnObjectByOtherObjectPattern;
const forceOnObjectByOtherObjectWithUnitsPatternString = inverseSquareLawCommonStrings.forceOnObjectByOtherObjectWithUnitsPattern;
const forceOnObjectByOtherObjectPatternString = InverseSquareLawCommonStrings.forceOnObjectByOtherObjectPattern;
const forceOnObjectByOtherObjectWithUnitsPatternString = InverseSquareLawCommonStrings.forceOnObjectByOtherObjectWithUnitsPattern;

// constants
const ARROW_LENGTH = 8; // empirically determined
Expand Down
12 changes: 6 additions & 6 deletions js/view/ISLCForceValuesDisplayControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ import { Text, VBox } from '../../../scenery/js/imports.js';
import VerticalAquaRadioButtonGroup from '../../../sun/js/VerticalAquaRadioButtonGroup.js';
import Tandem from '../../../tandem/js/Tandem.js';
import inverseSquareLawCommon from '../inverseSquareLawCommon.js';
import inverseSquareLawCommonStrings from '../inverseSquareLawCommonStrings.js';
import InverseSquareLawCommonStrings from '../InverseSquareLawCommonStrings.js';
import ISLCConstants from '../ISLCConstants.js';
import ForceValuesDisplayEnum from '../model/ForceValuesDisplayEnum.js';

// constants
const decimalNotationString = inverseSquareLawCommonStrings.decimalNotation;
const forceValuesString = inverseSquareLawCommonStrings.forceValues;
const hiddenString = inverseSquareLawCommonStrings.hidden;
const scientificNotationString = inverseSquareLawCommonStrings.scientificNotation;
const forceValuesHelpTextString = inverseSquareLawCommonStrings.a11y.forceValuesHelpText;
const decimalNotationString = InverseSquareLawCommonStrings.decimalNotation;
const forceValuesString = InverseSquareLawCommonStrings.forceValues;
const hiddenString = InverseSquareLawCommonStrings.hidden;
const scientificNotationString = InverseSquareLawCommonStrings.scientificNotation;
const forceValuesHelpTextString = InverseSquareLawCommonStrings.a11y.forceValuesHelpText;

const TEXT_TANDEM_NAME = 'labelText';

Expand Down
4 changes: 2 additions & 2 deletions js/view/ISLCObjectControlPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import PhetFont from '../../../scenery-phet/js/PhetFont.js';
import { GroupFocusHighlightFromNode, Text } from '../../../scenery/js/imports.js';
import Tandem from '../../../tandem/js/Tandem.js';
import inverseSquareLawCommon from '../inverseSquareLawCommon.js';
import inverseSquareLawCommonStrings from '../inverseSquareLawCommonStrings.js';
import InverseSquareLawCommonStrings from '../InverseSquareLawCommonStrings.js';
import ISLCPanel from './ISLCPanel.js';

const pattern0Value1UnitsString = inverseSquareLawCommonStrings.pattern_0value_1units;
const pattern0Value1UnitsString = InverseSquareLawCommonStrings.pattern_0value_1units;

// constants
const TITLE_MAX_WIDTH = 150; // max widths are set empirically to handle long strings
Expand Down
16 changes: 8 additions & 8 deletions js/view/ISLCRulerNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import StringUtils from '../../../phetcommon/js/util/StringUtils.js';
import GrabDragInteraction from '../../../scenery-phet/js/accessibility/GrabDragInteraction.js';
import PhetFont from '../../../scenery-phet/js/PhetFont.js';
import RulerNode from '../../../scenery-phet/js/RulerNode.js';
import sceneryPhetStrings from '../../../scenery-phet/js/sceneryPhetStrings.js';
import SceneryPhetStrings from '../../../scenery-phet/js/SceneryPhetStrings.js';
import { DragListener, FocusHighlightFromNode, KeyboardDragListener, KeyboardUtils, Line, Node } from '../../../scenery/js/imports.js';
import SoundClip from '../../../tambo/js/sound-generators/SoundClip.js';
import SoundLevelEnum from '../../../tambo/js/SoundLevelEnum.js';
Expand All @@ -27,16 +27,16 @@ import Tandem from '../../../tandem/js/Tandem.js';
import Utterance from '../../../utterance-queue/js/Utterance.js';
import rulerMovement000_mp3 from '../../sounds/rulerMovement000_mp3.js';
import inverseSquareLawCommon from '../inverseSquareLawCommon.js';
import inverseSquareLawCommonStrings from '../inverseSquareLawCommonStrings.js';
import InverseSquareLawCommonStrings from '../InverseSquareLawCommonStrings.js';
import ISLCQueryParameters from '../ISLCQueryParameters.js';

// constants
const unitsCentimetersString = inverseSquareLawCommonStrings.units.centimeters;
const rulerHelpTextString = inverseSquareLawCommonStrings.a11y.ruler.rulerHelpText;
const rulerKeyboardHintString = inverseSquareLawCommonStrings.a11y.ruler.rulerKeyboardHint;
const gestureHelpTextPatternString = sceneryPhetStrings.a11y.grabDrag.gestureHelpTextPattern;
const rulerLabelString = inverseSquareLawCommonStrings.a11y.ruler.rulerLabel;
const measureDistanceRulerString = inverseSquareLawCommonStrings.a11y.ruler.measureDistanceRuler;
const unitsCentimetersString = InverseSquareLawCommonStrings.units.centimeters;
const rulerHelpTextString = InverseSquareLawCommonStrings.a11y.ruler.rulerHelpText;
const rulerKeyboardHintString = InverseSquareLawCommonStrings.a11y.ruler.rulerKeyboardHint;
const gestureHelpTextPatternString = SceneryPhetStrings.a11y.grabDrag.gestureHelpTextPattern;
const rulerLabelString = InverseSquareLawCommonStrings.a11y.ruler.rulerLabel;
const measureDistanceRulerString = InverseSquareLawCommonStrings.a11y.ruler.measureDistanceRuler;

const RULER_WIDTH = 500;
const RULER_HEIGHT = 35;
Expand Down
108 changes: 54 additions & 54 deletions js/view/describers/ForceDescriber.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,60 +12,60 @@ import merge from '../../../../phet-core/js/merge.js';
import StringUtils from '../../../../phetcommon/js/util/StringUtils.js';
import ScientificNotationNode from '../../../../scenery-phet/js/ScientificNotationNode.js';
import inverseSquareLawCommon from '../../inverseSquareLawCommon.js';
import inverseSquareLawCommonStrings from '../../inverseSquareLawCommonStrings.js';
import InverseSquareLawCommonStrings from '../../InverseSquareLawCommonStrings.js';
import ForceValuesDisplayEnum from '../../model/ForceValuesDisplayEnum.js';
import ISLCDescriber from './ISLCDescriber.js';

const unitsNewtonsString = inverseSquareLawCommonStrings.units.newtons;
const forceVectorArrowsString = inverseSquareLawCommonStrings.a11y.screenSummary.forceVectorArrows;
const summaryVectorSizePatternString = inverseSquareLawCommonStrings.a11y.screenSummary.summaryVectorSizePattern;
const summaryVectorSizeValueUnitsPatternString = inverseSquareLawCommonStrings.a11y.screenSummary.summaryVectorSizeValueUnitsPattern;
const forceVectorMagnitudeUnitsPatternString = inverseSquareLawCommonStrings.a11y.sphere.forceVectorMagnitudeUnitsPattern;
const forceAndVectorPatternString = inverseSquareLawCommonStrings.a11y.sphere.forceAndVectorPattern;
const forceVectorSizePatternString = inverseSquareLawCommonStrings.a11y.sphere.forceVectorSizePattern;
const robotPullSummaryPatternString = inverseSquareLawCommonStrings.a11y.screenSummary.robotPullSummaryPattern;
const robotPushSummaryPatternString = inverseSquareLawCommonStrings.a11y.screenSummary.robotPushSummaryPattern;
const vectorsString = inverseSquareLawCommonStrings.a11y.alerts.vectors;
const vectorsSizeClausePatternString = inverseSquareLawCommonStrings.a11y.alerts.vectorsSizeClausePattern;
const forcesValueUnitsClausePatternString = inverseSquareLawCommonStrings.a11y.alerts.forcesValueUnitsClausePattern;
const forceMagnitudeString = inverseSquareLawCommonStrings.a11y.sphere.forceMagnitude;
const forceVectorCapitalizedString = inverseSquareLawCommonStrings.a11y.sphere.forceVectorCapitalized;
const forceVectorsSizePatternString = inverseSquareLawCommonStrings.a11y.sphere.forceVectorsSizePattern;

const valuesInUnitsPatternString = inverseSquareLawCommonStrings.a11y.valuesInUnitsPattern;
const forcesInScientificNotationString = inverseSquareLawCommonStrings.a11y.forcesInScientificNotation;

const vectorChangePatternString = inverseSquareLawCommonStrings.a11y.alerts.vectorChangePattern;
const vectorsCapitalizedString = inverseSquareLawCommonStrings.a11y.alerts.vectorsCapitalized;
const vectorChangeForcesNowValuePatternString = inverseSquareLawCommonStrings.a11y.alerts.vectorChangeForcesNowValuePattern;
const vectorChangeSentencePatternString = inverseSquareLawCommonStrings.a11y.alerts.vectorChangeSentencePattern;
const vectorChangeClausePatternString = inverseSquareLawCommonStrings.a11y.alerts.vectorChangeClausePattern;
const vectorChangeForcesNowClausePatternString = inverseSquareLawCommonStrings.a11y.alerts.vectorChangeForcesNowClausePattern;
const vectorForceClausePatternString = inverseSquareLawCommonStrings.a11y.vectorForceClausePattern;
const regionForceClausePatternString = inverseSquareLawCommonStrings.a11y.regionForceClausePattern;

const tinyString = inverseSquareLawCommonStrings.a11y.qualitative.tiny;
const verySmallString = inverseSquareLawCommonStrings.a11y.qualitative.verySmall;
const smallString = inverseSquareLawCommonStrings.a11y.qualitative.small;
const mediumSizeString = inverseSquareLawCommonStrings.a11y.qualitative.mediumSize;
const largeString = inverseSquareLawCommonStrings.a11y.qualitative.large;
const veryLargeString = inverseSquareLawCommonStrings.a11y.qualitative.veryLarge;
const hugeString = inverseSquareLawCommonStrings.a11y.qualitative.huge;

const getBiggerString = inverseSquareLawCommonStrings.a11y.qualitative.getBigger;
const getSmallerString = inverseSquareLawCommonStrings.a11y.qualitative.getSmaller;

const veryHardString = inverseSquareLawCommonStrings.a11y.pullerEffort.veryHard;
const hardString = inverseSquareLawCommonStrings.a11y.pullerEffort.hard;
const moderatelyString = inverseSquareLawCommonStrings.a11y.pullerEffort.moderately;
const gentlyString = inverseSquareLawCommonStrings.a11y.pullerEffort.gently;
const lighlyString = inverseSquareLawCommonStrings.a11y.pullerEffort.lightly;
const aLittleString = inverseSquareLawCommonStrings.a11y.pullerEffort.aLittle;
const aTinyBitString = inverseSquareLawCommonStrings.a11y.pullerEffort.aTinyBit;

const forceEqualsPatternString = inverseSquareLawCommonStrings.a11y.voicing.levels.forceEqualsPattern;
const forceArrowSizePatternString = inverseSquareLawCommonStrings.a11y.voicing.levels.forceArrowSizePattern;
const forceOnObjectsPatternString = inverseSquareLawCommonStrings.a11y.voicing.levels.forceOnObjectsPattern;
const unitsNewtonsString = InverseSquareLawCommonStrings.units.newtons;
const forceVectorArrowsString = InverseSquareLawCommonStrings.a11y.screenSummary.forceVectorArrows;
const summaryVectorSizePatternString = InverseSquareLawCommonStrings.a11y.screenSummary.summaryVectorSizePattern;
const summaryVectorSizeValueUnitsPatternString = InverseSquareLawCommonStrings.a11y.screenSummary.summaryVectorSizeValueUnitsPattern;
const forceVectorMagnitudeUnitsPatternString = InverseSquareLawCommonStrings.a11y.sphere.forceVectorMagnitudeUnitsPattern;
const forceAndVectorPatternString = InverseSquareLawCommonStrings.a11y.sphere.forceAndVectorPattern;
const forceVectorSizePatternString = InverseSquareLawCommonStrings.a11y.sphere.forceVectorSizePattern;
const robotPullSummaryPatternString = InverseSquareLawCommonStrings.a11y.screenSummary.robotPullSummaryPattern;
const robotPushSummaryPatternString = InverseSquareLawCommonStrings.a11y.screenSummary.robotPushSummaryPattern;
const vectorsString = InverseSquareLawCommonStrings.a11y.alerts.vectors;
const vectorsSizeClausePatternString = InverseSquareLawCommonStrings.a11y.alerts.vectorsSizeClausePattern;
const forcesValueUnitsClausePatternString = InverseSquareLawCommonStrings.a11y.alerts.forcesValueUnitsClausePattern;
const forceMagnitudeString = InverseSquareLawCommonStrings.a11y.sphere.forceMagnitude;
const forceVectorCapitalizedString = InverseSquareLawCommonStrings.a11y.sphere.forceVectorCapitalized;
const forceVectorsSizePatternString = InverseSquareLawCommonStrings.a11y.sphere.forceVectorsSizePattern;

const valuesInUnitsPatternString = InverseSquareLawCommonStrings.a11y.valuesInUnitsPattern;
const forcesInScientificNotationString = InverseSquareLawCommonStrings.a11y.forcesInScientificNotation;

const vectorChangePatternString = InverseSquareLawCommonStrings.a11y.alerts.vectorChangePattern;
const vectorsCapitalizedString = InverseSquareLawCommonStrings.a11y.alerts.vectorsCapitalized;
const vectorChangeForcesNowValuePatternString = InverseSquareLawCommonStrings.a11y.alerts.vectorChangeForcesNowValuePattern;
const vectorChangeSentencePatternString = InverseSquareLawCommonStrings.a11y.alerts.vectorChangeSentencePattern;
const vectorChangeClausePatternString = InverseSquareLawCommonStrings.a11y.alerts.vectorChangeClausePattern;
const vectorChangeForcesNowClausePatternString = InverseSquareLawCommonStrings.a11y.alerts.vectorChangeForcesNowClausePattern;
const vectorForceClausePatternString = InverseSquareLawCommonStrings.a11y.vectorForceClausePattern;
const regionForceClausePatternString = InverseSquareLawCommonStrings.a11y.regionForceClausePattern;

const tinyString = InverseSquareLawCommonStrings.a11y.qualitative.tiny;
const verySmallString = InverseSquareLawCommonStrings.a11y.qualitative.verySmall;
const smallString = InverseSquareLawCommonStrings.a11y.qualitative.small;
const mediumSizeString = InverseSquareLawCommonStrings.a11y.qualitative.mediumSize;
const largeString = InverseSquareLawCommonStrings.a11y.qualitative.large;
const veryLargeString = InverseSquareLawCommonStrings.a11y.qualitative.veryLarge;
const hugeString = InverseSquareLawCommonStrings.a11y.qualitative.huge;

const getBiggerString = InverseSquareLawCommonStrings.a11y.qualitative.getBigger;
const getSmallerString = InverseSquareLawCommonStrings.a11y.qualitative.getSmaller;

const veryHardString = InverseSquareLawCommonStrings.a11y.pullerEffort.veryHard;
const hardString = InverseSquareLawCommonStrings.a11y.pullerEffort.hard;
const moderatelyString = InverseSquareLawCommonStrings.a11y.pullerEffort.moderately;
const gentlyString = InverseSquareLawCommonStrings.a11y.pullerEffort.gently;
const lighlyString = InverseSquareLawCommonStrings.a11y.pullerEffort.lightly;
const aLittleString = InverseSquareLawCommonStrings.a11y.pullerEffort.aLittle;
const aTinyBitString = InverseSquareLawCommonStrings.a11y.pullerEffort.aTinyBit;

const forceEqualsPatternString = InverseSquareLawCommonStrings.a11y.voicing.levels.forceEqualsPattern;
const forceArrowSizePatternString = InverseSquareLawCommonStrings.a11y.voicing.levels.forceArrowSizePattern;
const forceOnObjectsPatternString = InverseSquareLawCommonStrings.a11y.voicing.levels.forceOnObjectsPattern;

const SIZE_STRINGS = [
tinyString,
Expand All @@ -88,9 +88,9 @@ const PULL_EFFORT_STINGS = [
const CHANGE_DIRECTIONS = [ getSmallerString, null, getBiggerString ];

// scientific notation
const scientificNotationPatternString = inverseSquareLawCommonStrings.a11y.scientificNotationPattern;
const negativeValuePatternString = inverseSquareLawCommonStrings.a11y.negativeValuePattern;
const valuePatternString = inverseSquareLawCommonStrings.a11y.valuePattern;
const scientificNotationPatternString = InverseSquareLawCommonStrings.a11y.scientificNotationPattern;
const negativeValuePatternString = InverseSquareLawCommonStrings.a11y.negativeValuePattern;
const valuePatternString = InverseSquareLawCommonStrings.a11y.valuePattern;

class ForceDescriber extends ISLCDescriber {

Expand Down
Loading

0 comments on commit 6010a52

Please sign in to comment.