Skip to content

Commit

Permalink
Convert EnumerationDeprecated to new Enumeration pattern, phetsims/ra…
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Jan 24, 2022
1 parent 8bbbc16 commit 7d7db21
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions js/keyboard/help/SliderControlsKeyboardHelpSection.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
*/

import validate from '../../../../axon/js/validate.js';
import EnumerationDeprecated from '../../../../phet-core/js/EnumerationDeprecated.js';
import Enumeration from '../../../../phet-core/js/Enumeration.js';
import EnumerationValue from '../../../../phet-core/js/EnumerationValue.js';
import merge from '../../../../phet-core/js/merge.js';
import StringUtils from '../../../../phetcommon/js/util/StringUtils.js';
import { HBox } from '../../../../scenery/js/imports.js';
Expand All @@ -17,7 +18,13 @@ import TextKeyNode from '../TextKeyNode.js';
import KeyboardHelpIconFactory from './KeyboardHelpIconFactory.js';
import KeyboardHelpSection from './KeyboardHelpSection.js';

const ArrowKeyIconDisplay = EnumerationDeprecated.byKeys( [ 'UP_DOWN', 'LEFT_RIGHT', 'BOTH' ] );
class ArrowKeyIconDisplay extends EnumerationValue {
static UP_DOWN = new ArrowKeyIconDisplay();
static LEFT_RIGHT = new ArrowKeyIconDisplay();
static BOTH = new ArrowKeyIconDisplay();

static enumeration = new Enumeration( ArrowKeyIconDisplay );
}

class SliderControlsKeyboardHelpSection extends KeyboardHelpSection {

Expand Down Expand Up @@ -161,7 +168,7 @@ class SliderControlsKeyboardHelpSection extends KeyboardHelpSection {
}
}

// @public - for use in defining a component-specific option.
// @public {ArrowKeyIconDisplay} - for use in defining a component-specific option.
SliderControlsKeyboardHelpSection.ArrowKeyIconDisplay = ArrowKeyIconDisplay;

sceneryPhet.register( 'SliderControlsKeyboardHelpSection', SliderControlsKeyboardHelpSection );
Expand Down

0 comments on commit 7d7db21

Please sign in to comment.