diff --git a/js/common/model/Allele.ts b/js/common/model/Allele.ts index a2c793f4..0407571b 100644 --- a/js/common/model/Allele.ts +++ b/js/common/model/Allele.ts @@ -12,7 +12,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../axon/js/Disposable.js'; import TReadOnlyProperty from '../../../../axon/js/TReadOnlyProperty.js'; import optionize from '../../../../phet-core/js/optionize.js'; import PickRequired from '../../../../phet-core/js/types/PickRequired.js'; @@ -56,6 +55,7 @@ export default class Allele extends PhetioObject { const options = optionize()( { // PhetioObjectOptions + isDisposable: false, phetioType: Allele.AlleleIO, phetioState: false }, providedOptions ); @@ -70,11 +70,6 @@ export default class Allele extends PhetioObject { this.tandemNamePrefix = options.tandemNamePrefix; } - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } - /** * AlleleIO implements 'Reference type serialization', as described in the Serialization section of * https://github.com/phetsims/phet-io/blob/master/doc/phet-io-instrumentation-technical-guide.md#serialization diff --git a/js/common/model/DataProbe.ts b/js/common/model/DataProbe.ts index 16e804e2..74aaba5a 100644 --- a/js/common/model/DataProbe.ts +++ b/js/common/model/DataProbe.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 Property from '../../../../axon/js/Property.js'; @@ -51,6 +50,7 @@ export default class DataProbe extends PhetioObject { const options = optionize()( { // PhetioObjectOptions + isDisposable: false, phetioState: false // to prevent serialization, because we don't have an IO Type }, providedOptions ); @@ -91,11 +91,6 @@ export default class DataProbe extends PhetioObject { this.visibleProperty.reset(); } - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } - /** * Gets the bunny counts for a specific generation value. * @param dataProbeGeneration - current position of the data probe on the x-axis diff --git a/js/common/model/Gene.ts b/js/common/model/Gene.ts index 997eec37..c730ddbb 100644 --- a/js/common/model/Gene.ts +++ b/js/common/model/Gene.ts @@ -18,7 +18,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 Property from '../../../../axon/js/Property.js'; @@ -108,6 +107,7 @@ export default class Gene extends PhetioObject { const options = optionize()( { // PhetioObjectOptions + isDisposable: false, phetioType: Gene.GeneIO, phetioState: false }, providedOptions ); @@ -163,11 +163,6 @@ export default class Gene extends PhetioObject { this.mutationComingProperty.reset(); } - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } - /** * Cancels a mutation that has been scheduled. */ diff --git a/js/common/model/GenerationClock.ts b/js/common/model/GenerationClock.ts index c2cb29a6..1c4e6765 100644 --- a/js/common/model/GenerationClock.ts +++ b/js/common/model/GenerationClock.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 from '../../../../axon/js/DerivedProperty.js'; import NumberProperty from '../../../../axon/js/NumberProperty.js'; @@ -46,6 +45,7 @@ export default class GenerationClock extends PhetioObject { const options = optionize()( { // PhetioObjectOptions + isDisposable: false, phetioState: false, // to prevent serialization, because we don't have an IO Type phetioDocumentation: 'the clock that marks the duration of a generation' }, providedOptions ); @@ -113,11 +113,6 @@ export default class GenerationClock extends PhetioObject { this.timeInSecondsProperty.reset(); } - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } - /** * @param dt - the time step, in seconds */ diff --git a/js/common/model/Organism.ts b/js/common/model/Organism.ts index 4f87b494..b037afda 100644 --- a/js/common/model/Organism.ts +++ b/js/common/model/Organism.ts @@ -24,7 +24,7 @@ type SelfOptions = { }; export type OrganismOptions = SelfOptions & - PickOptional; + PickOptional; export default class Organism extends PhetioObject { diff --git a/js/common/model/PedigreeModel.ts b/js/common/model/PedigreeModel.ts index d31d234e..ab9c29ad 100644 --- a/js/common/model/PedigreeModel.ts +++ b/js/common/model/PedigreeModel.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 Property from '../../../../axon/js/Property.js'; import optionize, { EmptySelfOptions } from '../../../../phet-core/js/optionize.js'; @@ -30,6 +29,7 @@ export default class PedigreeModel extends PhetioObject { const options = optionize()( { // PhetioObjectOptions + isDisposable: false, phetioState: false, // to prevent serialization, because we don't have an IO Type phetioDocumentation: 'model elements that are specific to the Pedigree feature' }, providedOptions ); @@ -57,11 +57,6 @@ export default class PedigreeModel extends PhetioObject { this.earsAllelesVisibleProperty.reset(); this.teethAllelesVisibleProperty.reset(); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } naturalSelection.register( 'PedigreeModel', PedigreeModel ); \ No newline at end of file diff --git a/js/common/model/PopulationModel.ts b/js/common/model/PopulationModel.ts index 892f086b..d31b267d 100644 --- a/js/common/model/PopulationModel.ts +++ b/js/common/model/PopulationModel.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 createObservableArray, { ObservableArray } from '../../../../axon/js/createObservableArray.js'; import DerivedProperty from '../../../../axon/js/DerivedProperty.js'; @@ -99,6 +98,7 @@ export default class PopulationModel extends PhetioObject { xAxisLength: 5, // PhetioObjectOptions + isDisposable: false, phetioState: false, // to prevent serialization, because we don't have an IO Type phetioDocumentation: 'model elements that are specific to the Population feature' }, providedOptions ); @@ -253,11 +253,6 @@ export default class PopulationModel extends PhetioObject { } ); } - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } - public reset(): void { // Clear data points. Use this approach because these are instances of ObservableArrayDef. diff --git a/js/common/model/ProportionsModel.ts b/js/common/model/ProportionsModel.ts index 1242ef42..63ac268a 100644 --- a/js/common/model/ProportionsModel.ts +++ b/js/common/model/ProportionsModel.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 createObservableArray, { ObservableArray } from '../../../../axon/js/createObservableArray.js'; import DerivedProperty from '../../../../axon/js/DerivedProperty.js'; @@ -73,6 +72,7 @@ export default class ProportionsModel extends PhetioObject { const options = optionize()( { // PhetioObjectOptions + isDisposable: false, phetioState: false, // to prevent serialization, because we don't have an IO Type phetioDocumentation: 'model elements that are specific to the Proportions feature' }, providedOptions ); @@ -226,11 +226,6 @@ export default class ProportionsModel extends PhetioObject { this.teethVisibleProperty.reset(); } - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } - /** * Records start counts for the current generation. */ diff --git a/js/common/model/Shrub.ts b/js/common/model/Shrub.ts index c611c172..d4b1c328 100644 --- a/js/common/model/Shrub.ts +++ b/js/common/model/Shrub.ts @@ -6,25 +6,22 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../axon/js/Disposable.js'; -import { EmptySelfOptions } from '../../../../phet-core/js/optionize.js'; +import optionize, { EmptySelfOptions } from '../../../../phet-core/js/optionize.js'; import naturalSelection from '../../naturalSelection.js'; import EnvironmentModelViewTransform from './EnvironmentModelViewTransform.js'; import Organism, { OrganismOptions } from './Organism.js'; +import StrictOmit from '../../../../phet-core/js/types/StrictOmit.js'; type SelfOptions = EmptySelfOptions; -type ShrubOptions = SelfOptions & OrganismOptions; +type ShrubOptions = SelfOptions & StrictOmit; export default class Shrub extends Organism { - public constructor( modelViewTransform: EnvironmentModelViewTransform, options?: ShrubOptions ) { - super( modelViewTransform, options ); - } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); + public constructor( modelViewTransform: EnvironmentModelViewTransform, providedOptions?: ShrubOptions ) { + super( modelViewTransform, optionize()( { + isDisposable: false + }, providedOptions ) ); } } diff --git a/js/common/view/AddMutationsPanel.ts b/js/common/view/AddMutationsPanel.ts index 6cb9fce3..d99cf223 100644 --- a/js/common/view/AddMutationsPanel.ts +++ b/js/common/view/AddMutationsPanel.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 TReadOnlyProperty from '../../../../axon/js/TReadOnlyProperty.js'; import optionize, { combineOptions, EmptySelfOptions, optionize3 } from '../../../../phet-core/js/optionize.js'; @@ -113,11 +112,6 @@ export default class AddMutationsPanel extends NaturalSelectionPanel { this.rows = rows; } - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } - /** * Gets the row that corresponds to a gene. */ @@ -164,7 +158,8 @@ class Row extends HBox { spacing: COLUMN_SPACING, visiblePropertyOptions: { phetioFeatured: true - } + }, + isDisposable: false }, providedOptions ); // label that indicates the gene, to the left of the push buttons @@ -266,11 +261,6 @@ class Row extends HBox { this.gene = gene; } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } type MutationButtonSelfOptions = EmptySelfOptions; @@ -389,7 +379,8 @@ class TitleNode extends Text { // TextOptions font: NaturalSelectionConstants.TITLE_FONT, - maxWidth: 180 // determined empirically + maxWidth: 180, // determined empirically + isDisposable: false }, providedOptions ); const stringProperty = new DerivedStringProperty( [ @@ -404,11 +395,6 @@ class TitleNode extends Text { super( stringProperty, options ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } naturalSelection.register( 'AddMutationsPanel', AddMutationsPanel ); \ No newline at end of file diff --git a/js/common/view/EnvironmentPanel.ts b/js/common/view/EnvironmentPanel.ts index bd648412..121477e5 100644 --- a/js/common/view/EnvironmentPanel.ts +++ b/js/common/view/EnvironmentPanel.ts @@ -43,7 +43,8 @@ export default class EnvironmentPanel extends Panel { cornerRadius: 0, fill: null, stroke: null, - phetioVisiblePropertyInstrumented: false + phetioVisiblePropertyInstrumented: false, + isDisposable: false }, providedOptions ); // Where the bunnies, food, etc. are displayed diff --git a/js/common/view/EnvironmentRadioButtonGroup.ts b/js/common/view/EnvironmentRadioButtonGroup.ts index b931f764..57283767 100644 --- a/js/common/view/EnvironmentRadioButtonGroup.ts +++ b/js/common/view/EnvironmentRadioButtonGroup.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 optionize, { EmptySelfOptions } from '../../../../phet-core/js/optionize.js'; import PickRequired from '../../../../phet-core/js/types/PickRequired.js'; @@ -52,7 +51,8 @@ export default class EnvironmentRadioButtonGroup extends RectangularRadioButtonG }, enabledPropertyOptions: { phetioReadOnly: true // see https://github.com/phetsims/natural-selection/issues/296 - } + }, + isDisposable: false }, providedOptions ); // icons @@ -95,11 +95,6 @@ export default class EnvironmentRadioButtonGroup extends RectangularRadioButtonG super( environmentProperty, content, options ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } naturalSelection.register( 'EnvironmentRadioButtonGroup', EnvironmentRadioButtonGroup ); \ No newline at end of file diff --git a/js/common/view/EnvironmentalFactorsPanel.ts b/js/common/view/EnvironmentalFactorsPanel.ts index e1688753..d5f404a6 100644 --- a/js/common/view/EnvironmentalFactorsPanel.ts +++ b/js/common/view/EnvironmentalFactorsPanel.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 Property from '../../../../axon/js/Property.js'; import TReadOnlyProperty from '../../../../axon/js/TReadOnlyProperty.js'; @@ -96,11 +95,6 @@ export default class EnvironmentalFactorsPanel extends NaturalSelectionPanel { super( content, options ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } type TitleTextSelfOptions = EmptySelfOptions; @@ -121,7 +115,8 @@ class TitleText extends Text { phetioVisiblePropertyInstrumented: true, visiblePropertyOptions: { phetioFeatured: true - } + }, + isDisposable: false }, providedOptions ); const stringProperty = new DerivedStringProperty( [ @@ -136,11 +131,6 @@ class TitleText extends Text { super( stringProperty, options ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } naturalSelection.register( 'EnvironmentalFactorsPanel', EnvironmentalFactorsPanel ); \ No newline at end of file diff --git a/js/common/view/GenerationClockNode.ts b/js/common/view/GenerationClockNode.ts index 93cadaf4..18390733 100644 --- a/js/common/view/GenerationClockNode.ts +++ b/js/common/view/GenerationClockNode.ts @@ -8,7 +8,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../axon/js/Disposable.js'; import Range from '../../../../dot/js/Range.js'; import { Shape } from '../../../../kite/js/imports.js'; import PatternStringProperty from '../../../../axon/js/PatternStringProperty.js'; @@ -44,7 +43,8 @@ export default class GenerationClockNode extends Node { // NodeOptions visiblePropertyOptions: { phetioFeatured: true - } + }, + isDisposable: false }, providedOptions ); // The full center of the clock. @@ -121,11 +121,6 @@ export default class GenerationClockNode extends Node { } ); } - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } - /** * Creates an icon with one slice of the clock filled in. */ diff --git a/js/common/view/GraphChoiceRadioButtonGroup.ts b/js/common/view/GraphChoiceRadioButtonGroup.ts index b5c47ddd..f3234f0c 100644 --- a/js/common/view/GraphChoiceRadioButtonGroup.ts +++ b/js/common/view/GraphChoiceRadioButtonGroup.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 optionize, { combineOptions, EmptySelfOptions } from '../../../../phet-core/js/optionize.js'; import PickRequired from '../../../../phet-core/js/types/PickRequired.js'; @@ -40,7 +39,8 @@ export default class GraphChoiceRadioButtonGroup extends VerticalAquaRadioButton // VerticalAquaRadioButtonGroupOptions spacing: 12, touchAreaXDilation: 8, - mouseAreaXDilation: 8 + mouseAreaXDilation: 8, + isDisposable: false }, providedOptions ); // Create the description of the buttons @@ -89,11 +89,6 @@ export default class GraphChoiceRadioButtonGroup extends VerticalAquaRadioButton super( graphChoiceProperty, items, options ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } naturalSelection.register( 'GraphChoiceRadioButtonGroup', GraphChoiceRadioButtonGroup ); \ No newline at end of file diff --git a/js/common/view/MutationAlertsNode.ts b/js/common/view/MutationAlertsNode.ts index ab54c2a7..959fe252 100644 --- a/js/common/view/MutationAlertsNode.ts +++ b/js/common/view/MutationAlertsNode.ts @@ -6,7 +6,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../axon/js/Disposable.js'; import Vector2 from '../../../../dot/js/Vector2.js'; import { Node, NodeOptions } from '../../../../scenery/js/imports.js'; import naturalSelection from '../../naturalSelection.js'; @@ -29,7 +28,8 @@ export default class MutationAlertsNode extends Node { const options = optionize()( { // NodeOptions - phetioVisiblePropertyInstrumented: false + phetioVisiblePropertyInstrumented: false, + isDisposable: false }, providedOptions ); // Create a MutationComingNode (aka 'alert') for each gene @@ -65,11 +65,6 @@ export default class MutationAlertsNode extends Node { } ); } ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } naturalSelection.register( 'MutationAlertsNode', MutationAlertsNode ); \ No newline at end of file diff --git a/js/common/view/MutationComingNode.ts b/js/common/view/MutationComingNode.ts index 7c9cb90e..16df1675 100644 --- a/js/common/view/MutationComingNode.ts +++ b/js/common/view/MutationComingNode.ts @@ -8,7 +8,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../axon/js/Disposable.js'; import { Shape } from '../../../../kite/js/imports.js'; import { HBox, Node, NodeOptions, Path, Text } from '../../../../scenery/js/imports.js'; import naturalSelection from '../../naturalSelection.js'; @@ -36,7 +35,8 @@ export default class MutationComingNode extends Node { const options = optionize()( { // NodeOptions - visiblePropertyOptions: { phetioReadOnly: true } + visiblePropertyOptions: { phetioReadOnly: true }, + isDisposable: false }, providedOptions ); const cancelButton = new CancelMutationButton( { @@ -78,11 +78,6 @@ export default class MutationComingNode extends Node { this.gene = gene; } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } naturalSelection.register( 'MutationComingNode', MutationComingNode ); \ No newline at end of file diff --git a/js/common/view/NaturalSelectionPanel.ts b/js/common/view/NaturalSelectionPanel.ts index 656fc0db..b2719202 100644 --- a/js/common/view/NaturalSelectionPanel.ts +++ b/js/common/view/NaturalSelectionPanel.ts @@ -31,7 +31,10 @@ export default class NaturalSelectionPanel extends Panel { const options = optionize()( { // SelfOptions - fixedWidth: null + fixedWidth: null, + + // PanelOptions + isDisposable: false }, providedOptions ); assert && assert( options.fixedWidth === null || options.fixedWidth > 0, diff --git a/js/common/view/NaturalSelectionScreenView.ts b/js/common/view/NaturalSelectionScreenView.ts index 4235c3ea..a4d7765f 100644 --- a/js/common/view/NaturalSelectionScreenView.ts +++ b/js/common/view/NaturalSelectionScreenView.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 Dimension2 from '../../../../dot/js/Dimension2.js'; import ScreenView, { ScreenViewOptions } from '../../../../joist/js/ScreenView.js'; @@ -61,7 +60,10 @@ export default class NaturalSelectionScreenView extends ScreenView { furVisible: true, earsVisible: true, teethVisible: true, - toughFoodCheckboxVisible: true + toughFoodCheckboxVisible: true, + + // ScreenViewOptions + isDisposable: false }, providedOptions ); super( providedOptions ); @@ -271,11 +273,6 @@ export default class NaturalSelectionScreenView extends ScreenView { this.resetNaturalSelectionScreenView(); } - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } - /** * Steps the view. * @param dt - time step, in seconds. Note that dt is currently not used by the view, and constrained by diff --git a/js/common/view/NaturalSelectionTimeControlNode.ts b/js/common/view/NaturalSelectionTimeControlNode.ts index 8bbb3e31..03c013a6 100644 --- a/js/common/view/NaturalSelectionTimeControlNode.ts +++ b/js/common/view/NaturalSelectionTimeControlNode.ts @@ -9,7 +9,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../axon/js/Disposable.js'; import EnumerationProperty from '../../../../axon/js/EnumerationProperty.js'; import Property from '../../../../axon/js/Property.js'; import optionize, { EmptySelfOptions } from '../../../../phet-core/js/optionize.js'; @@ -41,7 +40,8 @@ export default class NaturalSelectionTimeControlNode extends HBox { phetioEnabledPropertyInstrumented: true, // opt into default PhET-iO instrumented enabledProperty visiblePropertyOptions: { phetioFeatured: true - } + }, + isDisposable: false }, providedOptions ); const playPauseButton = new PlayPauseButton( isPlayingProperty, { @@ -86,11 +86,6 @@ export default class NaturalSelectionTimeControlNode extends HBox { } } ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } naturalSelection.register( 'NaturalSelectionTimeControlNode', NaturalSelectionTimeControlNode ); \ No newline at end of file diff --git a/js/common/view/PerformanceTimesNode.ts b/js/common/view/PerformanceTimesNode.ts index 8de08be5..5e20b2c5 100644 --- a/js/common/view/PerformanceTimesNode.ts +++ b/js/common/view/PerformanceTimesNode.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 TReadOnlyProperty from '../../../../axon/js/TReadOnlyProperty.js'; import Utils from '../../../../dot/js/Utils.js'; @@ -31,7 +30,8 @@ export default class PerformanceTimesNode extends VBox { // VBoxOptions align: 'left', - spacing: 5 + spacing: 5, + isDisposable: false }, providedOptions ); // unlink is not necessary. @@ -62,11 +62,6 @@ export default class PerformanceTimesNode extends VBox { super( options ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } naturalSelection.register( 'PerformanceTimesNode', PerformanceTimesNode ); \ No newline at end of file diff --git a/js/common/view/PlayButtonGroup.ts b/js/common/view/PlayButtonGroup.ts index a86b1a70..d7a5113d 100644 --- a/js/common/view/PlayButtonGroup.ts +++ b/js/common/view/PlayButtonGroup.ts @@ -22,7 +22,6 @@ import NaturalSelectionStrings from '../../NaturalSelectionStrings.js'; import SimulationMode from '../model/SimulationMode.js'; import NaturalSelectionColors from '../NaturalSelectionColors.js'; import NaturalSelectionConstants from '../NaturalSelectionConstants.js'; -import Disposable from '../../../../axon/js/Disposable.js'; type SelfOptions = { @@ -44,7 +43,10 @@ export default class PlayButtonGroup extends Node { // SelfOptions addAMate: _.noop, play: _.noop, - startOver: _.noop + startOver: _.noop, + + // NodeOptions + isDisposable: false }, providedOptions ); // 'Add a Mate' push button, for when the initial population consists of a single bunny. @@ -124,11 +126,6 @@ export default class PlayButtonGroup extends Node { } ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } type TextPushButtonSelfOptions = { @@ -161,7 +158,8 @@ class TextPushButton extends RectangularPushButton { }, enabledPropertyOptions: { phetioFeatured: false - } + }, + isDisposable: false }, providedOptions ); options.content = new Text( stringProperty, combineOptions( {}, options.textOptions, { diff --git a/js/common/view/environment/EnvironmentBackgroundNode.ts b/js/common/view/environment/EnvironmentBackgroundNode.ts index 78660a7f..12e7971a 100644 --- a/js/common/view/environment/EnvironmentBackgroundNode.ts +++ b/js/common/view/environment/EnvironmentBackgroundNode.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 Dimension2 from '../../../../../dot/js/Dimension2.js'; import { Image, Line, Node } from '../../../../../scenery/js/imports.js'; @@ -45,7 +44,8 @@ export default class EnvironmentBackgroundNode extends Node { } super( { - children: children + children: children, + isDisposable: false } ); // Show the background that matches the environment. unlink is not necessary. @@ -54,11 +54,6 @@ export default class EnvironmentBackgroundNode extends Node { arcticBackground.visible = ( environment === Environment.ARCTIC ); } ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } naturalSelection.register( 'EnvironmentBackgroundNode', EnvironmentBackgroundNode ); \ No newline at end of file diff --git a/js/common/view/environment/EnvironmentNode.ts b/js/common/view/environment/EnvironmentNode.ts index c3f2b585..892a473e 100644 --- a/js/common/view/environment/EnvironmentNode.ts +++ b/js/common/view/environment/EnvironmentNode.ts @@ -7,7 +7,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../../axon/js/Disposable.js'; import Bounds2 from '../../../../../dot/js/Bounds2.js'; import Dimension2 from '../../../../../dot/js/Dimension2.js'; import optionize from '../../../../../phet-core/js/optionize.js'; @@ -41,7 +40,8 @@ export default class EnvironmentNode extends Node { // NodeOptions phetioDocumentation: 'the area of the screen that displays what is happening in the environment', - phetioVisiblePropertyInstrumented: false + phetioVisiblePropertyInstrumented: false, + isDisposable: false }, providedOptions ); const bounds = new Bounds2( 0, 0, options.size.width, options.size.height ); @@ -76,11 +76,6 @@ export default class EnvironmentNode extends Node { this.sprites = sprites; } - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } - /** * Updates all sprites. */ diff --git a/js/common/view/pedigree/AllelesPanel.ts b/js/common/view/pedigree/AllelesPanel.ts index 7a829a4d..c2a58779 100644 --- a/js/common/view/pedigree/AllelesPanel.ts +++ b/js/common/view/pedigree/AllelesPanel.ts @@ -10,7 +10,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../../axon/js/Disposable.js'; import Property from '../../../../../axon/js/Property.js'; import optionize, { combineOptions, EmptySelfOptions, optionize4 } from '../../../../../phet-core/js/optionize.js'; import StrictOmit from '../../../../../phet-core/js/types/StrictOmit.js'; @@ -82,11 +81,6 @@ export default class AllelesPanel extends NaturalSelectionPanel { this.rows = rows; } - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } - /** * Sets visibility of the UI components related to a specific gene. */ @@ -123,7 +117,8 @@ class Row extends VBox { excludeInvisibleChildrenFromBounds: false, visiblePropertyOptions: { phetioFeatured: true - } + }, + isDisposable: false }, providedOptions ); const checkboxTandem = options.tandem.createTandem( 'checkbox' ); @@ -209,11 +204,6 @@ class Row extends VBox { this.gene = gene; } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } naturalSelection.register( 'AllelesPanel', AllelesPanel ); \ No newline at end of file diff --git a/js/common/view/pedigree/PedigreeGraphNode.ts b/js/common/view/pedigree/PedigreeGraphNode.ts index 6f74c1d4..3ced2427 100644 --- a/js/common/view/pedigree/PedigreeGraphNode.ts +++ b/js/common/view/pedigree/PedigreeGraphNode.ts @@ -7,7 +7,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../../axon/js/Disposable.js'; import Property from '../../../../../axon/js/Property.js'; import optionize from '../../../../../phet-core/js/optionize.js'; import PickRequired from '../../../../../phet-core/js/types/PickRequired.js'; @@ -46,7 +45,8 @@ export default class PedigreeGraphNode extends Node { graphHeight: 100, // NodeOptions - phetioVisiblePropertyInstrumented: false + phetioVisiblePropertyInstrumented: false, + isDisposable: false }, providedOptions ); const backgroundNode = new Rectangle( 0, 0, options.graphWidth, options.graphHeight, { @@ -109,11 +109,6 @@ export default class PedigreeGraphNode extends Node { tandemName: 'selectedBunnyProperty' } ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } naturalSelection.register( 'PedigreeGraphNode', PedigreeGraphNode ); \ No newline at end of file diff --git a/js/common/view/pedigree/PedigreeNode.ts b/js/common/view/pedigree/PedigreeNode.ts index a15143ac..ab032e03 100644 --- a/js/common/view/pedigree/PedigreeNode.ts +++ b/js/common/view/pedigree/PedigreeNode.ts @@ -6,7 +6,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../../axon/js/Disposable.js'; import Dimension2 from '../../../../../dot/js/Dimension2.js'; import optionize, { EmptySelfOptions } from '../../../../../phet-core/js/optionize.js'; import PickRequired from '../../../../../phet-core/js/types/PickRequired.js'; @@ -44,7 +43,8 @@ export default class PedigreeNode extends HBox { align: 'center', excludeInvisibleChildrenFromBounds: false, phetioDocumentation: 'the Pedigree graph and its control panel', - visiblePropertyOptions: { phetioReadOnly: true } + visiblePropertyOptions: { phetioReadOnly: true }, + isDisposable: false }, providedOptions ); // Divy up the width @@ -85,11 +85,6 @@ export default class PedigreeNode extends HBox { this.allelesPanel = allelesPanel; } - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } - /** * Sets visibility of the UI components related to a specific gene. */ diff --git a/js/common/view/population/DataProbeNode.ts b/js/common/view/population/DataProbeNode.ts index d2b81dad..6c4a93b6 100644 --- a/js/common/view/population/DataProbeNode.ts +++ b/js/common/view/population/DataProbeNode.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 Property from '../../../../../axon/js/Property.js'; import TReadOnlyProperty from '../../../../../axon/js/TReadOnlyProperty.js'; @@ -71,7 +70,8 @@ export default class DataProbeNode extends Node { offset: Vector2.ZERO, // NodeOptions - cursor: 'ew-resize' // east-west arrows, <-> + cursor: 'ew-resize', // east-west arrows, <-> + isDisposable: false }, providedOptions ); const dataProbe = populationModel.dataProbe; @@ -174,11 +174,6 @@ export default class DataProbeNode extends Node { tandemName: 'dataProbe' } ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } /** diff --git a/js/common/view/population/PopulationGenerationScroller.ts b/js/common/view/population/PopulationGenerationScroller.ts index 4fdd6d1f..4af5b939 100644 --- a/js/common/view/population/PopulationGenerationScroller.ts +++ b/js/common/view/population/PopulationGenerationScroller.ts @@ -11,7 +11,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../../axon/js/Disposable.js'; import Multilink from '../../../../../axon/js/Multilink.js'; import Property from '../../../../../axon/js/Property.js'; import TReadOnlyProperty from '../../../../../axon/js/TReadOnlyProperty.js'; @@ -50,7 +49,8 @@ export default class PopulationGenerationScroller extends HBox { // HBoxOptions spacing: 10, - phetioVisiblePropertyInstrumented: false + phetioVisiblePropertyInstrumented: false, + isDisposable: false }, providedOptions ); // Maintain the initial range length @@ -100,11 +100,6 @@ export default class PopulationGenerationScroller extends HBox { forwardButton.enabled = ( range.max < max ); } ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } naturalSelection.register( 'PopulationGenerationScroller', PopulationGenerationScroller ); \ No newline at end of file diff --git a/js/common/view/population/PopulationGraphNode.ts b/js/common/view/population/PopulationGraphNode.ts index ab044ff1..ac4daf2c 100644 --- a/js/common/view/population/PopulationGraphNode.ts +++ b/js/common/view/population/PopulationGraphNode.ts @@ -7,7 +7,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../../axon/js/Disposable.js'; import Bounds2 from '../../../../../dot/js/Bounds2.js'; import Vector2 from '../../../../../dot/js/Vector2.js'; import optionize from '../../../../../phet-core/js/optionize.js'; @@ -46,7 +45,8 @@ export default class PopulationGraphNode extends Node { graphHeight: 100, // NodeOptions - phetioVisiblePropertyInstrumented: false + phetioVisiblePropertyInstrumented: false, + isDisposable: false }, providedOptions ); // invisible rectangle that defines the bounds of this Node @@ -148,11 +148,6 @@ export default class PopulationGraphNode extends Node { super( options ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } naturalSelection.register( 'PopulationGraphNode', PopulationGraphNode ); \ No newline at end of file diff --git a/js/common/view/population/PopulationGridNode.ts b/js/common/view/population/PopulationGridNode.ts index 6ebc0d8c..37a129c2 100644 --- a/js/common/view/population/PopulationGridNode.ts +++ b/js/common/view/population/PopulationGridNode.ts @@ -7,7 +7,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../../axon/js/Disposable.js'; import TReadOnlyProperty from '../../../../../axon/js/TReadOnlyProperty.js'; import Range from '../../../../../dot/js/Range.js'; import { Shape } from '../../../../../kite/js/imports.js'; @@ -43,7 +42,10 @@ export default class PopulationGridNode extends Node { // SelfOptions gridWidth: 100, - gridHeight: 100 + gridHeight: 100, + + // NodeOptions + isDisposable: false }, providedOptions ); // Background rectangle @@ -130,11 +132,6 @@ export default class PopulationGridNode extends Node { super( options ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } /** @@ -166,7 +163,8 @@ class VerticalLines extends Node { // VerticalLinesSelfOptions xSpacingModel: 1, xAxisWidth: 100, - lineLength: 100 + lineLength: 100, + isDisposable: false }, providedOptions ); // Compute the number of lines and their spacing, in view coordinates @@ -192,11 +190,6 @@ class VerticalLines extends Node { super( options ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } /** @@ -227,7 +220,10 @@ class HorizontalLines extends Path { // HorizontalLinesSelfOptions yAxisHeight: 100, - lineLength: 100 + lineLength: 100, + + // PathOptions + isDisposable: false }, providedOptions ); super( new Shape() ); @@ -252,11 +248,6 @@ class HorizontalLines extends Path { this.mutate( options ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } /** @@ -283,7 +274,10 @@ class XTickLabels extends Node { // XTickLabelsSelfOptions xSpacingModel: 1, - xAxisWidth: 100 + xAxisWidth: 100, + + // NodeOptions + isDisposable: false }, providedOptions ); // Compute the number of labels and their spacing, in view coordinates @@ -321,11 +315,6 @@ class XTickLabels extends Node { } } ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } /** @@ -353,7 +342,10 @@ class YTickLabels extends Node { const options = optionize()( { // YTickLabelsSelfOptions - yAxisHeight: 100 + yAxisHeight: 100, + + // NodeOptions + isDisposable: false }, providedOptions ); super(); @@ -384,11 +376,6 @@ class YTickLabels extends Node { this.mutate( options ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } /** diff --git a/js/common/view/population/PopulationLegendCheckbox.ts b/js/common/view/population/PopulationLegendCheckbox.ts index b5d6d5fa..9e7dca13 100644 --- a/js/common/view/population/PopulationLegendCheckbox.ts +++ b/js/common/view/population/PopulationLegendCheckbox.ts @@ -7,7 +7,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../../axon/js/Disposable.js'; import Property from '../../../../../axon/js/Property.js'; import TReadOnlyProperty from '../../../../../axon/js/TReadOnlyProperty.js'; import { optionize4 } from '../../../../../phet-core/js/optionize.js'; @@ -47,7 +46,8 @@ export default class PopulationLegendCheckbox extends Checkbox { const options = optionize4()( {}, NaturalSelectionConstants.CHECKBOX_OPTIONS, { lineColor: 'black', - isLineDashed: false + isLineDashed: false, + isDisposable: false }, providedOptions ); // solid or dashed line @@ -76,11 +76,6 @@ export default class PopulationLegendCheckbox extends Checkbox { super( plotVisibleProperty, content, options ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } naturalSelection.register( 'PopulationLegendCheckbox', PopulationLegendCheckbox ); \ No newline at end of file diff --git a/js/common/view/population/PopulationNode.ts b/js/common/view/population/PopulationNode.ts index 7c877ff8..fd6a4bb8 100644 --- a/js/common/view/population/PopulationNode.ts +++ b/js/common/view/population/PopulationNode.ts @@ -6,7 +6,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../../axon/js/Disposable.js'; import Dimension2 from '../../../../../dot/js/Dimension2.js'; import optionize, { EmptySelfOptions } from '../../../../../phet-core/js/optionize.js'; import PickRequired from '../../../../../phet-core/js/types/PickRequired.js'; @@ -37,7 +36,8 @@ export default class PopulationNode extends Node { // NodeOptions phetioDocumentation: 'the Population graph and its control panel', - visiblePropertyOptions: { phetioReadOnly: true } + visiblePropertyOptions: { phetioReadOnly: true }, + isDisposable: false }, providedOptions ); // Divvy up the width @@ -70,11 +70,6 @@ export default class PopulationNode extends Node { this.populationPanel = populationPanel; } - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } - /** * Sets visibility of the UI components related to a specific gene. */ diff --git a/js/common/view/population/PopulationPanel.ts b/js/common/view/population/PopulationPanel.ts index b195a832..4cecb1c0 100644 --- a/js/common/view/population/PopulationPanel.ts +++ b/js/common/view/population/PopulationPanel.ts @@ -6,7 +6,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../../axon/js/Disposable.js'; import { combineOptions, EmptySelfOptions, optionize4 } from '../../../../../phet-core/js/optionize.js'; import StrictOmit from '../../../../../phet-core/js/types/StrictOmit.js'; import { AlignBox, AlignGroup, HSeparator, Text, VBox, VBoxOptions } from '../../../../../scenery/js/imports.js'; @@ -158,11 +157,6 @@ export default class PopulationPanel extends NaturalSelectionPanel { this.alleleCheckboxes = alleleCheckboxes; } - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } - /** * Sets visibility of the UI components related to a specific gene. */ diff --git a/js/common/view/proportions/ProportionsBarNode.ts b/js/common/view/proportions/ProportionsBarNode.ts index 083a8352..329132a8 100644 --- a/js/common/view/proportions/ProportionsBarNode.ts +++ b/js/common/view/proportions/ProportionsBarNode.ts @@ -7,7 +7,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../../axon/js/Disposable.js'; import Multilink from '../../../../../axon/js/Multilink.js'; import TReadOnlyProperty from '../../../../../axon/js/TReadOnlyProperty.js'; import Utils from '../../../../../dot/js/Utils.js'; @@ -52,7 +51,8 @@ export default class ProportionsBarNode extends Node { barHeight: 30, // NodeOptions - phetioReadOnly: true + phetioReadOnly: true, + isDisposable: false }, providedOptions ); // Portions of the bar for normal and mutant counts. normalRectangle remains a fixed size. mutantRectangle @@ -105,11 +105,6 @@ export default class ProportionsBarNode extends Node { ); } - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } - /** * Sets the counts and triggers an update of the display. */ diff --git a/js/common/view/proportions/ProportionsGraphNode.ts b/js/common/view/proportions/ProportionsGraphNode.ts index efc75c6a..652b0a7d 100644 --- a/js/common/view/proportions/ProportionsGraphNode.ts +++ b/js/common/view/proportions/ProportionsGraphNode.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 Property from '../../../../../axon/js/Property.js'; import TReadOnlyProperty from '../../../../../axon/js/TReadOnlyProperty.js'; @@ -57,7 +56,8 @@ export default class ProportionsGraphNode extends Node { graphHeight: 100, // NodeOptions - phetioVisiblePropertyInstrumented: false + phetioVisiblePropertyInstrumented: false, + isDisposable: false }, providedOptions ); // To make this code easier to read @@ -210,11 +210,6 @@ export default class ProportionsGraphNode extends Node { this.geneColumns = geneColumns; } - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } - /** * Sets visibility of the UI components related to a specific gene. */ @@ -251,7 +246,8 @@ class RowLabel extends VBox { // VBoxOptions spacing: 2, align: 'left', - phetioVisiblePropertyInstrumented: false + phetioVisiblePropertyInstrumented: false, + isDisposable: false }, providedOptions ); const countProperty = new NumberProperty( count, { @@ -293,11 +289,6 @@ class RowLabel extends VBox { this.countProperty = countProperty; } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } /** @@ -330,7 +321,8 @@ class Column extends VBox { align: 'center', visiblePropertyOptions: { phetioReadOnly: true - } + }, + isDisposable: false }, providedOptions ); // Checkbox to hide the column @@ -390,11 +382,6 @@ class Column extends VBox { this.endBarNode = endBarNode; } - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } - /** * Sets the counts for the 'start' bar. */ diff --git a/js/common/view/proportions/ProportionsLegendNode.ts b/js/common/view/proportions/ProportionsLegendNode.ts index f019a40e..3d3e5847 100644 --- a/js/common/view/proportions/ProportionsLegendNode.ts +++ b/js/common/view/proportions/ProportionsLegendNode.ts @@ -7,7 +7,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../../axon/js/Disposable.js'; import TReadOnlyProperty from '../../../../../axon/js/TReadOnlyProperty.js'; import optionize, { EmptySelfOptions, optionize4 } from '../../../../../phet-core/js/optionize.js'; import PickRequired from '../../../../../phet-core/js/types/PickRequired.js'; @@ -39,7 +38,8 @@ export default class ProportionsLegendNode extends VBox { spacing: 25, visiblePropertyOptions: { phetioFeatured: true - } + }, + isDisposable: false }, providedOptions ); // A legend for each gene @@ -57,11 +57,6 @@ export default class ProportionsLegendNode extends VBox { this.legendNodes = legendNodes; } - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } - /** * Sets visibility of the UI components related to a specific gene. */ @@ -94,7 +89,8 @@ class GeneLegendNode extends VBox { {}, NaturalSelectionConstants.VBOX_OPTIONS, { // VBoxOptions - visiblePropertyOptions: { phetioReadOnly: true } + visiblePropertyOptions: { phetioReadOnly: true }, + isDisposable: false }, providedOptions ); options.children = [ @@ -111,11 +107,6 @@ class GeneLegendNode extends VBox { this.gene = gene; } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } /** @@ -140,6 +131,7 @@ class AlleleLegendNode extends HBox { // HBoxOptions spacing: 5, + isDisposable: false, phetioVisiblePropertyInstrumented: false }, providedOptions ); @@ -161,11 +153,6 @@ class AlleleLegendNode extends HBox { super( options ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } naturalSelection.register( 'ProportionsLegendNode', ProportionsLegendNode ); \ No newline at end of file diff --git a/js/common/view/proportions/ProportionsNode.ts b/js/common/view/proportions/ProportionsNode.ts index b1a78d2e..f675615e 100644 --- a/js/common/view/proportions/ProportionsNode.ts +++ b/js/common/view/proportions/ProportionsNode.ts @@ -6,7 +6,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../../axon/js/Disposable.js'; import Dimension2 from '../../../../../dot/js/Dimension2.js'; import optionize, { EmptySelfOptions } from '../../../../../phet-core/js/optionize.js'; import PickRequired from '../../../../../phet-core/js/types/PickRequired.js'; @@ -37,7 +36,8 @@ export default class ProportionsNode extends HBox { align: 'center', excludeInvisibleChildrenFromBounds: false, phetioDocumentation: 'the Proportions graph and its control panel', - visiblePropertyOptions: { phetioReadOnly: true } + visiblePropertyOptions: { phetioReadOnly: true }, + isDisposable: false }, providedOptions ); // Divy up the width @@ -69,11 +69,6 @@ export default class ProportionsNode extends HBox { this.proportionsGraphNode = proportionsGraphNode; } - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } - /** * Sets visibility of the UI components related to a specific gene. */ diff --git a/js/common/view/proportions/ProportionsPanel.ts b/js/common/view/proportions/ProportionsPanel.ts index 7a76807b..e421da41 100644 --- a/js/common/view/proportions/ProportionsPanel.ts +++ b/js/common/view/proportions/ProportionsPanel.ts @@ -6,7 +6,6 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../../../axon/js/Disposable.js'; import Property from '../../../../../axon/js/Property.js'; import { combineOptions, EmptySelfOptions, optionize4 } from '../../../../../phet-core/js/optionize.js'; import StrictOmit from '../../../../../phet-core/js/types/StrictOmit.js'; @@ -80,11 +79,6 @@ export default class ProportionsPanel extends NaturalSelectionPanel { this.legendNode = legendNode; } - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } - /** * Sets visibility of the UI components related to a specific gene. */ diff --git a/js/intro/IntroScreen.ts b/js/intro/IntroScreen.ts index 96e4f899..ab03f7ea 100644 --- a/js/intro/IntroScreen.ts +++ b/js/intro/IntroScreen.ts @@ -6,9 +6,8 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../axon/js/Disposable.js'; import Property from '../../../axon/js/Property.js'; -import Screen from '../../../joist/js/Screen.js'; +import Screen, { ScreenOptions } from '../../../joist/js/Screen.js'; import ScreenIcon from '../../../joist/js/ScreenIcon.js'; import { HBox, Image } from '../../../scenery/js/imports.js'; import Tandem from '../../../tandem/js/Tandem.js'; @@ -24,16 +23,13 @@ export default class IntroScreen extends Screen { public constructor( tandem: Tandem ) { - const options = { - - // Screen options + const options: ScreenOptions = { name: NaturalSelectionStrings.screen.introStringProperty, homeScreenIcon: createScreenIcon(), backgroundColorProperty: new Property( NaturalSelectionColors.SCREEN_VIEW_BACKGROUND, { tandem: Tandem.OPT_OUT } ), - - // phet-io + isDisposable: false, tandem: tandem }; @@ -43,11 +39,6 @@ export default class IntroScreen extends Screen { options ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } /** diff --git a/js/lab/LabScreen.ts b/js/lab/LabScreen.ts index 93873691..354a76b7 100644 --- a/js/lab/LabScreen.ts +++ b/js/lab/LabScreen.ts @@ -6,9 +6,8 @@ * @author Chris Malley (PixelZoom, Inc.) */ -import Disposable from '../../../axon/js/Disposable.js'; import Property from '../../../axon/js/Property.js'; -import Screen from '../../../joist/js/Screen.js'; +import Screen, { ScreenOptions } from '../../../joist/js/Screen.js'; import ScreenIcon from '../../../joist/js/ScreenIcon.js'; import { HBox, Image, VBox } from '../../../scenery/js/imports.js'; import Tandem from '../../../tandem/js/Tandem.js'; @@ -30,16 +29,13 @@ export default class LabScreen extends Screen { public constructor( tandem: Tandem ) { - const options = { - - // Screen options + const options: ScreenOptions = { name: NaturalSelectionStrings.screen.labStringProperty, homeScreenIcon: createScreenIcon(), backgroundColorProperty: new Property( NaturalSelectionColors.SCREEN_VIEW_BACKGROUND, { tandem: Tandem.OPT_OUT } ), - - // phet-io + isDisposable: false, tandem: tandem }; @@ -49,11 +45,6 @@ export default class LabScreen extends Screen { options ); } - - public override dispose(): void { - Disposable.assertNotDisposable(); - super.dispose(); - } } /**