From b5c901e1f608d0cf9dfdb8fce14fd1eb87767b23 Mon Sep 17 00:00:00 2001 From: pixelzoom Date: Wed, 5 Jul 2023 11:48:48 -0600 Subject: [PATCH] use isDisposable:false where appropriate, https://github.com/phetsims/axon/issues/436 --- js/common/FMWConstants.ts | 1 + js/common/model/FourierSeries.ts | 7 +---- js/common/model/Harmonic.ts | 7 +---- js/common/view/AmplitudeKeypadDialog.ts | 7 +---- js/common/view/AmplitudeNumberDisplay.ts | 7 +---- js/common/view/AmplitudeSlider.ts | 19 ++---------- js/common/view/DomainChartNode.ts | 11 +++---- js/common/view/DomainComboBox.ts | 7 +---- .../view/InteractiveAmplitudesChartNode.ts | 9 ++---- .../MeasurementToolsKeyboardHelpSection.ts | 11 ++----- js/discrete/DiscreteScreen.ts | 7 +---- js/discrete/view/DiscreteControlPanel.ts | 31 +++---------------- .../view/DiscreteKeyboardHelpContent.ts | 11 ++----- .../view/DiscreteMeasurementToolNode.ts | 9 ++---- js/discrete/view/DiscreteScreenView.ts | 7 +---- js/discrete/view/EquationComboBox.ts | 7 +---- js/discrete/view/ExpandedFormDialog.ts | 7 +---- js/discrete/view/FourierSoundGenerator.ts | 2 +- js/discrete/view/HarmonicsEquationNode.ts | 7 +---- js/discrete/view/PeriodClockNode.ts | 6 ---- js/waveGame/WaveGameScreen.ts | 7 +---- .../view/WaveGameKeyboardHelpContent.ts | 20 +++--------- js/waveGame/view/WaveGameScreenView.ts | 7 +---- js/wavepacket/WavePacketScreen.ts | 7 +---- js/wavepacket/view/CenterControl.ts | 6 ---- js/wavepacket/view/ComponentSpacingControl.ts | 6 ---- js/wavepacket/view/ComponentsEquationText.ts | 7 +---- .../view/ConjugateStandardDeviationControl.ts | 6 ---- .../view/StandardDeviationControl.ts | 6 ---- .../view/WavePacketAmplitudesChartNode.ts | 6 ---- .../view/WavePacketComponentsChartNode.ts | 6 ---- js/wavepacket/view/WavePacketControlPanel.ts | 25 +++------------ .../view/WavePacketMeasurementToolNode.ts | 7 +---- js/wavepacket/view/WavePacketScreenView.ts | 7 +---- js/wavepacket/view/WavePacketSumChartNode.ts | 6 ---- .../view/WavePacketSumEquationNode.ts | 7 +---- 36 files changed, 50 insertions(+), 266 deletions(-) diff --git a/js/common/FMWConstants.ts b/js/common/FMWConstants.ts index 5d721af2..cc39b1b7 100644 --- a/js/common/FMWConstants.ts +++ b/js/common/FMWConstants.ts @@ -49,6 +49,7 @@ const PANEL_OPTIONS: PanelOptions = { const WAVE_PACKET_NUMBER_CONTROL_OPTIONS: NumberControlOptions = { // NumberControl options + isDisposable: false, includeArrowButtons: false, layoutFunction: ( titleNode: Node, numberDisplay: NumberDisplay, slider: Slider, leftArrowButton: ArrowButton | null, rightArrowButton: ArrowButton | null ): Node => new VBox( { spacing: 5, diff --git a/js/common/model/FourierSeries.ts b/js/common/model/FourierSeries.ts index 1849fe1d..9466ce57 100644 --- a/js/common/model/FourierSeries.ts +++ b/js/common/model/FourierSeries.ts @@ -8,7 +8,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../axon/js/Disposable.js'; import BooleanProperty from '../../../../axon/js/BooleanProperty.js'; import DerivedProperty, { UnknownDerivedProperty } from '../../../../axon/js/DerivedProperty.js'; import NumberProperty from '../../../../axon/js/NumberProperty.js'; @@ -77,6 +76,7 @@ export default class FourierSeries extends PhetioObject { amplitudes: DEFAULT_AMPLITUDES, // {number[]} initial amplitudes for the harmonics // PhetioObjectOptions + isDisposable: false, phetioState: false }, providedOptions ); @@ -131,11 +131,6 @@ export default class FourierSeries extends PhetioObject { } ); } - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } - /** * Resets the Fourier series. */ diff --git a/js/common/model/Harmonic.ts b/js/common/model/Harmonic.ts index 9f4b4fa9..4f5de67f 100644 --- a/js/common/model/Harmonic.ts +++ b/js/common/model/Harmonic.ts @@ -8,7 +8,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../axon/js/Disposable.js'; import NumberProperty from '../../../../axon/js/NumberProperty.js'; import TReadOnlyProperty from '../../../../axon/js/TReadOnlyProperty.js'; import Range from '../../../../dot/js/Range.js'; @@ -61,6 +60,7 @@ export default class Harmonic extends PhetioObject { amplitude: 0, // PhetioObjectOptions + isDisposable: false, phetioState: false }, providedOptions ); @@ -84,11 +84,6 @@ export default class Harmonic extends PhetioObject { } ); } - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } - public reset(): void { this.amplitudeProperty.reset(); } diff --git a/js/common/view/AmplitudeKeypadDialog.ts b/js/common/view/AmplitudeKeypadDialog.ts index 70206304..806d5e49 100644 --- a/js/common/view/AmplitudeKeypadDialog.ts +++ b/js/common/view/AmplitudeKeypadDialog.ts @@ -7,7 +7,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../axon/js/Disposable.js'; import NumberProperty from '../../../../axon/js/NumberProperty.js'; import PatternStringProperty from '../../../../axon/js/PatternStringProperty.js'; import Range from '../../../../dot/js/Range.js'; @@ -67,6 +66,7 @@ export default class AmplitudeKeypadDialog extends Dialog { decimalPlaces: FMWConstants.DISCRETE_AMPLITUDE_DECIMAL_PLACES, // DialogOptions + isDisposable: false, closeButtonLength: 12, cornerRadius: FMWConstants.PANEL_CORNER_RADIUS, layoutStrategy: ( dialog: Dialog, simBounds: Bounds2, screenBounds: Bounds2, scale: number ) => { @@ -223,11 +223,6 @@ export default class AmplitudeKeypadDialog extends Dialog { this.closeCallback = null; this.keypad.clear(); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } /** diff --git a/js/common/view/AmplitudeNumberDisplay.ts b/js/common/view/AmplitudeNumberDisplay.ts index 2edaa1e9..243ad511 100644 --- a/js/common/view/AmplitudeNumberDisplay.ts +++ b/js/common/view/AmplitudeNumberDisplay.ts @@ -7,7 +7,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../axon/js/Disposable.js'; import DerivedProperty from '../../../../axon/js/DerivedProperty.js'; import NumberDisplay, { NumberDisplayOptions } from '../../../../scenery-phet/js/NumberDisplay.js'; import PhetColorScheme from '../../../../scenery-phet/js/PhetColorScheme.js'; @@ -54,6 +53,7 @@ export default class AmplitudeNumberDisplay extends InteractiveHighlighting( VBo }, // VBoxOptions + isDisposable: false, cursor: 'pointer', spacing: 2, align: 'center', @@ -127,11 +127,6 @@ export default class AmplitudeNumberDisplay extends InteractiveHighlighting( VBo } } ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } fourierMakingWaves.register( 'AmplitudeNumberDisplay', AmplitudeNumberDisplay ); \ No newline at end of file diff --git a/js/common/view/AmplitudeSlider.ts b/js/common/view/AmplitudeSlider.ts index 05522d8d..e3f9263c 100644 --- a/js/common/view/AmplitudeSlider.ts +++ b/js/common/view/AmplitudeSlider.ts @@ -7,7 +7,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../axon/js/Disposable.js'; import BooleanProperty from '../../../../axon/js/BooleanProperty.js'; import DerivedProperty from '../../../../axon/js/DerivedProperty.js'; import Dimension2 from '../../../../dot/js/Dimension2.js'; @@ -59,6 +58,7 @@ export default class AmplitudeSlider extends Slider { mouseTouchStep: FMWConstants.DISCRETE_AMPLITUDE_STEP, // SliderOptions + isDisposable: false, startDrag: _.noop, endDrag: _.noop, orientation: Orientation.VERTICAL, @@ -139,11 +139,6 @@ export default class AmplitudeSlider extends Slider { this.visibleProperty.link( () => this.interruptSubtreeInput() ); } - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } - /** * Creates a non-interactive icon for an AmplitudeSlider. */ @@ -196,14 +191,10 @@ class GrippyThumb extends Node { super( { children: [ rectangle, dotsNode ], + isDisposable: false, tandem: tandem } ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } /** @@ -231,6 +222,7 @@ class BarTrack extends SliderTrack { const options = optionize()( { // SliderTrackOptions + isDisposable: false, size: new Dimension2( 10, 10 ) }, providedOptions ); @@ -285,11 +277,6 @@ class BarTrack extends SliderTrack { ( isPressed, isOverVisible ) => ( isPressed || isOverVisible ) ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } fourierMakingWaves.register( 'AmplitudeSlider', AmplitudeSlider ); \ No newline at end of file diff --git a/js/common/view/DomainChartNode.ts b/js/common/view/DomainChartNode.ts index 0366176a..0a162426 100644 --- a/js/common/view/DomainChartNode.ts +++ b/js/common/view/DomainChartNode.ts @@ -12,7 +12,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../axon/js/Disposable.js'; import Multilink from '../../../../axon/js/Multilink.js'; import AxisLine, { AxisLineOptions } from '../../../../bamboo/js/AxisLine.js'; import ChartRectangle, { ChartRectangleOptions } from '../../../../bamboo/js/ChartRectangle.js'; @@ -152,7 +151,10 @@ export default class DomainChartNode extends Node { }, yTickLabelSetOptions: { edge: DEFAULT_EDGE - } + }, + + // NodeOptions + isDisposable: false }, providedOptions ); // the transform between model and view coordinate frames @@ -256,11 +258,6 @@ export default class DomainChartNode extends Node { this.chartRectangle = chartRectangle; } - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } - /** * Computes the clipArea that will trim any data that is outside of a given amplitude range. * This is used to trim anomalies that occur when the x-axis is zoomed way out. diff --git a/js/common/view/DomainComboBox.ts b/js/common/view/DomainComboBox.ts index 4476c458..4b6b1e31 100644 --- a/js/common/view/DomainComboBox.ts +++ b/js/common/view/DomainComboBox.ts @@ -7,7 +7,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../axon/js/Disposable.js'; import { Node } from '../../../../scenery/js/imports.js'; import ComboBox from '../../../../sun/js/ComboBox.js'; import fourierMakingWaves from '../../fourierMakingWaves.js'; @@ -49,14 +48,10 @@ export default class DomainComboBox extends FMWComboBox { textOptions: { maxWidth: 100 // determined empirically }, + isDisposable: false, tandem: tandem } ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } fourierMakingWaves.register( 'DomainComboBox', DomainComboBox ); \ No newline at end of file diff --git a/js/common/view/InteractiveAmplitudesChartNode.ts b/js/common/view/InteractiveAmplitudesChartNode.ts index 913de63d..e845d59a 100644 --- a/js/common/view/InteractiveAmplitudesChartNode.ts +++ b/js/common/view/InteractiveAmplitudesChartNode.ts @@ -12,7 +12,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../axon/js/Disposable.js'; import ChartRectangle from '../../../../bamboo/js/ChartRectangle.js'; import ChartTransform, { ChartTransformOptions } from '../../../../bamboo/js/ChartTransform.js'; import GridLineSet from '../../../../bamboo/js/GridLineSet.js'; @@ -73,7 +72,8 @@ export default class InteractiveAmplitudesChartNode extends Node { chartTransformOptions: { viewWidth: FMWConstants.CHART_RECTANGLE_SIZE.width, viewHeight: FMWConstants.CHART_RECTANGLE_SIZE.height - } + }, + isDisposable: false }, providedOptions ); assert && assert( !options.chartTransformOptions.modelXRange, 'InteractiveAmplitudesChartNode sets modelXRange' ); @@ -184,11 +184,6 @@ export default class InteractiveAmplitudesChartNode extends Node { this.slidersParent = slidersParent; this.numberDisplays = numberDisplays; } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } fourierMakingWaves.register( 'InteractiveAmplitudesChartNode', InteractiveAmplitudesChartNode ); \ No newline at end of file diff --git a/js/common/view/MeasurementToolsKeyboardHelpSection.ts b/js/common/view/MeasurementToolsKeyboardHelpSection.ts index ad427117..b68dc83e 100644 --- a/js/common/view/MeasurementToolsKeyboardHelpSection.ts +++ b/js/common/view/MeasurementToolsKeyboardHelpSection.ts @@ -9,7 +9,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../axon/js/Disposable.js'; import KeyboardHelpIconFactory from '../../../../scenery-phet/js/keyboard/help/KeyboardHelpIconFactory.js'; import KeyboardHelpSection from '../../../../scenery-phet/js/keyboard/help/KeyboardHelpSection.js'; import KeyboardHelpSectionRow from '../../../../scenery-phet/js/keyboard/help/KeyboardHelpSectionRow.js'; @@ -41,13 +40,9 @@ export default class MeasurementToolsKeyboardHelpSection extends KeyboardHelpSec [ shiftPlusArrowsIcon, shiftPlusWASDsIcon ] ) ]; - super( FourierMakingWavesStrings.keyboardHelpDialog.measurementToolsStringProperty, rows ); - } - - // See https://github.com/phetsims/fourier-making-waves/issues/236 - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); + super( FourierMakingWavesStrings.keyboardHelpDialog.measurementToolsStringProperty, rows, { + isDisposable: false // see https://github.com/phetsims/fourier-making-waves/issues/236 + } ); } } diff --git a/js/discrete/DiscreteScreen.ts b/js/discrete/DiscreteScreen.ts index 9cd1b674..6f2323b9 100644 --- a/js/discrete/DiscreteScreen.ts +++ b/js/discrete/DiscreteScreen.ts @@ -6,7 +6,6 @@ * @author Chris Malley (PixelZoom, Inc. */ -import Disposable from '../../../axon/js/Disposable.js'; import Screen from '../../../joist/js/Screen.js'; import Tandem from '../../../tandem/js/Tandem.js'; import FMWColors from '../common/FMWColors.js'; @@ -26,6 +25,7 @@ export default class DiscreteScreen extends Screen new DiscreteKeyboardHelpContent(), + isDisposable: false, tandem: tandem }; @@ -35,11 +35,6 @@ export default class DiscreteScreen extends Screen periodCheckbox.interruptSubtreeInput() ); periodSpinner.enabledProperty.link( () => periodSpinner.interruptSubtreeInput() ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } /** @@ -418,6 +401,7 @@ class SoundBox extends HBox { // HBoxOptions children: [ soundEnabledCheckbox, sliderBox ], spacing: 20, + isDisposable: false, tandem: tandem } ); @@ -430,11 +414,6 @@ class SoundBox extends HBox { maxVolumeIcon.opacity = audioAndSoundEnabled ? 1 : SceneryConstants.DISABLED_OPACITY; } ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } fourierMakingWaves.register( 'DiscreteControlPanel', DiscreteControlPanel ); \ No newline at end of file diff --git a/js/discrete/view/DiscreteKeyboardHelpContent.ts b/js/discrete/view/DiscreteKeyboardHelpContent.ts index a0fbb1d9..53691158 100644 --- a/js/discrete/view/DiscreteKeyboardHelpContent.ts +++ b/js/discrete/view/DiscreteKeyboardHelpContent.ts @@ -6,7 +6,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../axon/js/Disposable.js'; import BasicActionsKeyboardHelpSection from '../../../../scenery-phet/js/keyboard/help/BasicActionsKeyboardHelpSection.js'; import SliderControlsKeyboardHelpSection from '../../../../scenery-phet/js/keyboard/help/SliderControlsKeyboardHelpSection.js'; import TwoColumnKeyboardHelpContent from '../../../../scenery-phet/js/keyboard/help/TwoColumnKeyboardHelpContent.js'; @@ -28,13 +27,9 @@ export default class DiscreteKeyboardHelpContent extends TwoColumnKeyboardHelpCo } ) ]; - super( leftSections, rightSections ); - } - - // See https://github.com/phetsims/fourier-making-waves/issues/236 - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); + super( leftSections, rightSections, { + isDisposable: false // See https://github.com/phetsims/fourier-making-waves/issues/236 + } ); } } diff --git a/js/discrete/view/DiscreteMeasurementToolNode.ts b/js/discrete/view/DiscreteMeasurementToolNode.ts index ff537cf9..23d17821 100644 --- a/js/discrete/view/DiscreteMeasurementToolNode.ts +++ b/js/discrete/view/DiscreteMeasurementToolNode.ts @@ -14,7 +14,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../axon/js/Disposable.js'; import BooleanProperty from '../../../../axon/js/BooleanProperty.js'; import DerivedProperty from '../../../../axon/js/DerivedProperty.js'; import EnumerationProperty from '../../../../axon/js/EnumerationProperty.js'; @@ -68,7 +67,8 @@ export default class DiscreteMeasurementToolNode extends Node { // NodeOptions cursor: 'pointer', tagName: 'div', - focusable: true + focusable: true, + isDisposable: false }, providedOptions ); assert && assert( !options.visibleProperty, 'DiscreteMeasurementToolNode sets visibleProperty' ); @@ -151,11 +151,6 @@ export default class DiscreteMeasurementToolNode extends Node { this.positionProperty = positionProperty; } - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } - public reset(): void { this.positionProperty.reset(); } diff --git a/js/discrete/view/DiscreteScreenView.ts b/js/discrete/view/DiscreteScreenView.ts index 5e2d0e01..0c849592 100644 --- a/js/discrete/view/DiscreteScreenView.ts +++ b/js/discrete/view/DiscreteScreenView.ts @@ -6,7 +6,6 @@ * @author Chris Malley (PixelZoom, Inc. */ -import Disposable from '../../../../axon/js/Disposable.js'; import DerivedProperty from '../../../../axon/js/DerivedProperty.js'; import Bounds2 from '../../../../dot/js/Bounds2.js'; import Vector2 from '../../../../dot/js/Vector2.js'; @@ -48,6 +47,7 @@ export default class DiscreteScreenView extends ScreenView { public constructor( model: DiscreteModel, tandem: Tandem ) { super( { + isDisposable: false, tandem: tandem } ); @@ -432,11 +432,6 @@ export default class DiscreteScreenView extends ScreenView { resetAllButton ]; } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } fourierMakingWaves.register( 'DiscreteScreenView', DiscreteScreenView ); \ No newline at end of file diff --git a/js/discrete/view/EquationComboBox.ts b/js/discrete/view/EquationComboBox.ts index 649a62b9..ed89b004 100644 --- a/js/discrete/view/EquationComboBox.ts +++ b/js/discrete/view/EquationComboBox.ts @@ -7,7 +7,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../axon/js/Disposable.js'; import EnumerationProperty from '../../../../axon/js/EnumerationProperty.js'; import { Node } from '../../../../scenery/js/imports.js'; import ComboBox from '../../../../sun/js/ComboBox.js'; @@ -95,6 +94,7 @@ export default class EquationComboBox extends FMWComboBox { textOptions: { maxWidth: 100 // determined empirically }, + isDisposable: false, tandem: tandem } ); @@ -121,11 +121,6 @@ export default class EquationComboBox extends FMWComboBox { this.setItemVisible( EquationForm.SPATIAL_WAVE_NUMBER_AND_ANGULAR_WAVE_NUMBER, isSpaceAmdTime ); } ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } fourierMakingWaves.register( 'EquationComboBox', EquationComboBox ); \ No newline at end of file diff --git a/js/discrete/view/ExpandedFormDialog.ts b/js/discrete/view/ExpandedFormDialog.ts index 6e91d148..1e3b7f78 100644 --- a/js/discrete/view/ExpandedFormDialog.ts +++ b/js/discrete/view/ExpandedFormDialog.ts @@ -8,7 +8,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../axon/js/Disposable.js'; import EnumerationProperty from '../../../../axon/js/EnumerationProperty.js'; import Multilink from '../../../../axon/js/Multilink.js'; import Utils from '../../../../dot/js/Utils.js'; @@ -103,16 +102,12 @@ export default class ExpandedFormDialog extends Dialog { // DialogOptions title: titleText, xSpacing: 30, + isDisposable: false, tandem: tandem, phetioReadOnly: true, phetioDocumentation: 'This dialog shows the expanded form of the Sum equation.' } ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } fourierMakingWaves.register( 'ExpandedFormDialog', ExpandedFormDialog ); \ No newline at end of file diff --git a/js/discrete/view/FourierSoundGenerator.ts b/js/discrete/view/FourierSoundGenerator.ts index 03e6afda..77c42191 100644 --- a/js/discrete/view/FourierSoundGenerator.ts +++ b/js/discrete/view/FourierSoundGenerator.ts @@ -27,7 +27,7 @@ export default class FourierSoundGenerator extends SoundGenerator { super( { - // OscillatorSoundGenerator options + // SoundGeneratorOptions initialOutputLevel: fourierSeries.soundOutputLevelProperty.value } ); diff --git a/js/discrete/view/HarmonicsEquationNode.ts b/js/discrete/view/HarmonicsEquationNode.ts index 24d622bd..0468352b 100644 --- a/js/discrete/view/HarmonicsEquationNode.ts +++ b/js/discrete/view/HarmonicsEquationNode.ts @@ -6,7 +6,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../axon/js/Disposable.js'; import EnumerationProperty from '../../../../axon/js/EnumerationProperty.js'; import Multilink from '../../../../axon/js/Multilink.js'; import { Node, RichText } from '../../../../scenery/js/imports.js'; @@ -34,6 +33,7 @@ export default class HarmonicsEquationNode extends Node { children: [ richText ], maxWidth: 0.5 * FMWConstants.CHART_RECTANGLE_SIZE.width, visiblePropertyOptions: { phetioReadOnly: true }, + isDisposable: false, tandem: tandem } ); @@ -44,11 +44,6 @@ export default class HarmonicsEquationNode extends Node { } ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } fourierMakingWaves.register( 'HarmonicsEquationNode', HarmonicsEquationNode ); \ No newline at end of file diff --git a/js/discrete/view/PeriodClockNode.ts b/js/discrete/view/PeriodClockNode.ts index 68da7fc4..fa40c211 100644 --- a/js/discrete/view/PeriodClockNode.ts +++ b/js/discrete/view/PeriodClockNode.ts @@ -8,7 +8,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../axon/js/Disposable.js'; import DerivedProperty from '../../../../axon/js/DerivedProperty.js'; import { Shape } from '../../../../kite/js/imports.js'; import { Circle, Color, Node, Path, Rectangle, RichText } from '../../../../scenery/js/imports.js'; @@ -147,11 +146,6 @@ class ClockFaceNode extends Node { } } ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } /** diff --git a/js/waveGame/WaveGameScreen.ts b/js/waveGame/WaveGameScreen.ts index 13208d85..c1980880 100644 --- a/js/waveGame/WaveGameScreen.ts +++ b/js/waveGame/WaveGameScreen.ts @@ -6,7 +6,6 @@ * @author Chris Malley (PixelZoom, Inc. */ -import Disposable from '../../../axon/js/Disposable.js'; import Screen from '../../../joist/js/Screen.js'; import Tandem from '../../../tandem/js/Tandem.js'; import FMWColors from '../common/FMWColors.js'; @@ -26,6 +25,7 @@ export default class WaveGameScreen extends Screen new WaveGameKeyboardHelpContent(), + isDisposable: false, tandem: tandem }; @@ -35,11 +35,6 @@ export default class WaveGameScreen extends Screen new WavePacketKeyboardHelpContent(), + isDisposable: false, tandem: tandem }; @@ -35,11 +35,6 @@ export default class WavePacketScreen extends Screen( {}, FMWConstants.PANEL_OPTIONS, { yMargin: 5, + isDisposable: false, tandem: tandem } ) ); @@ -171,11 +171,6 @@ class ComponentSpacingSubpanel extends VBox { this.componentSpacingText = componentSpacingText; } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } /** @@ -202,14 +197,10 @@ class WavePacketCenterSubpanel extends VBox { ], align: 'left', spacing: VERTICAL_SPACING, + isDisposable: false, tandem: tandem } ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } /** @@ -263,14 +254,10 @@ class WavePacketWidthSubpanel extends VBox { ], align: 'left', spacing: VERTICAL_SPACING, + isDisposable: false, tandem: tandem } ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } /** @@ -329,14 +316,10 @@ class GraphControlsSubpanel extends VBox { ], align: 'left', spacing: VERTICAL_SPACING, + isDisposable: false, tandem: tandem } ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } fourierMakingWaves.register( 'WavePacketControlPanel', WavePacketControlPanel ); \ No newline at end of file diff --git a/js/wavepacket/view/WavePacketMeasurementToolNode.ts b/js/wavepacket/view/WavePacketMeasurementToolNode.ts index 96da8d42..fa60e550 100644 --- a/js/wavepacket/view/WavePacketMeasurementToolNode.ts +++ b/js/wavepacket/view/WavePacketMeasurementToolNode.ts @@ -7,7 +7,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../axon/js/Disposable.js'; import EnumerationProperty from '../../../../axon/js/EnumerationProperty.js'; import Multilink from '../../../../axon/js/Multilink.js'; import Property from '../../../../axon/js/Property.js'; @@ -59,6 +58,7 @@ export default class WavePacketMeasurementToolNode extends Node { dragBounds: null, // NodeOptions + isDisposable: false, cursor: 'pointer', tagName: 'div', focusable: true @@ -167,11 +167,6 @@ export default class WavePacketMeasurementToolNode extends Node { public reset(): void { this.positionProperty.reset(); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } fourierMakingWaves.register( 'WavePacketMeasurementToolNode', WavePacketMeasurementToolNode ); \ No newline at end of file diff --git a/js/wavepacket/view/WavePacketScreenView.ts b/js/wavepacket/view/WavePacketScreenView.ts index 28a07cab..caec691d 100644 --- a/js/wavepacket/view/WavePacketScreenView.ts +++ b/js/wavepacket/view/WavePacketScreenView.ts @@ -6,7 +6,6 @@ * @author Chris Malley (PixelZoom, Inc. */ -import Disposable from '../../../../axon/js/Disposable.js'; import BooleanProperty from '../../../../axon/js/BooleanProperty.js'; import Bounds2 from '../../../../dot/js/Bounds2.js'; import Vector2 from '../../../../dot/js/Vector2.js'; @@ -38,6 +37,7 @@ export default class WavePacketScreenView extends ScreenView { public constructor( model: WavePacketModel, tandem: Tandem ) { super( { + isDisposable: false, tandem: tandem } ); @@ -372,11 +372,6 @@ export default class WavePacketScreenView extends ScreenView { resetAllButton ]; } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } fourierMakingWaves.register( 'WavePacketScreenView', WavePacketScreenView ); \ No newline at end of file diff --git a/js/wavepacket/view/WavePacketSumChartNode.ts b/js/wavepacket/view/WavePacketSumChartNode.ts index a8f23f52..6d6137e6 100644 --- a/js/wavepacket/view/WavePacketSumChartNode.ts +++ b/js/wavepacket/view/WavePacketSumChartNode.ts @@ -6,7 +6,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../axon/js/Disposable.js'; import CanvasLinePlot from '../../../../bamboo/js/CanvasLinePlot.js'; import ChartCanvasNode from '../../../../bamboo/js/ChartCanvasNode.js'; import { Node } from '../../../../scenery/js/imports.js'; @@ -123,11 +122,6 @@ export default class WavePacketSumChartNode extends DomainChartNode { waveformEnvelopeChartCanvasNode.update(); } ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } fourierMakingWaves.register( 'WavePacketSumChartNode', WavePacketSumChartNode ); \ No newline at end of file diff --git a/js/wavepacket/view/WavePacketSumEquationNode.ts b/js/wavepacket/view/WavePacketSumEquationNode.ts index 519ccace..e92a41f7 100644 --- a/js/wavepacket/view/WavePacketSumEquationNode.ts +++ b/js/wavepacket/view/WavePacketSumEquationNode.ts @@ -6,7 +6,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../axon/js/Disposable.js'; import EnumerationProperty from '../../../../axon/js/EnumerationProperty.js'; import Multilink from '../../../../axon/js/Multilink.js'; import NumberProperty from '../../../../axon/js/NumberProperty.js'; @@ -48,6 +47,7 @@ export default class WavePacketSumEquationNode extends Node { super( { children: [ leftNode, sumSymbolNode, rightNode ], maxWidth: 0.5 * FMWConstants.CHART_RECTANGLE_SIZE.width, + isDisposable: false, tandem: tandem } ); @@ -93,11 +93,6 @@ export default class WavePacketSumEquationNode extends Node { rightNode.y = leftNode.y; } ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } fourierMakingWaves.register( 'WavePacketSumEquationNode', WavePacketSumEquationNode ); \ No newline at end of file