Skip to content

Commit

Permalink
Move multilink and related methods to Multilink, see phetsims/axon#395
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed May 23, 2022
1 parent 9907773 commit 2c26506
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions js/atomic-interactions/model/DualAtomModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import BooleanProperty from '../../../../axon/js/BooleanProperty.js';
import EnumerationDeprecatedProperty from '../../../../axon/js/EnumerationDeprecatedProperty.js';
import EnumerationProperty from '../../../../axon/js/EnumerationProperty.js';
import NumberProperty from '../../../../axon/js/NumberProperty.js';
import Property from '../../../../axon/js/Property.js';
import Multilink from '../../../../axon/js/Multilink.js';
import Vector2 from '../../../../dot/js/Vector2.js';
import TimeSpeed from '../../../../scenery-phet/js/TimeSpeed.js';
import AtomType from '../../common/model/AtomType.js';
Expand Down Expand Up @@ -145,7 +145,7 @@ class DualAtomModel {
} );

// update the LJ potential parameters when the adjustable attraction atom is in use
Property.multilink(
Multilink.multilink(
[ this.atomPairProperty, this.adjustableAtomInteractionStrengthProperty, this.adjustableAtomDiameterProperty ],
( atomPair, interactionStrength, atomDiameter ) => {
if ( atomPair === AtomPair.ADJUSTABLE ) {
Expand Down
4 changes: 2 additions & 2 deletions js/atomic-interactions/view/InteractivePotentialGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @author John Blanco
*/

import Property from '../../../../axon/js/Property.js';
import Multilink from '../../../../axon/js/Multilink.js';
import Bounds2 from '../../../../dot/js/Bounds2.js';
import { Shape } from '../../../../kite/js/imports.js';
import merge from '../../../../phet-core/js/merge.js';
Expand Down Expand Up @@ -251,7 +251,7 @@ class InteractivePotentialGraph extends PotentialGraphNode {
this.positionMarker.changeColor( dualAtomModel.movableAtom.color );
} );

Property.multilink(
Multilink.multilink(
[ dualAtomModel.atomPairProperty, dualAtomModel.adjustableAtomInteractionStrengthProperty, dualAtomModel.adjustableAtomDiameterProperty ],
() => {
this.setLjPotentialParameters( dualAtomModel.getSigma(), dualAtomModel.getEpsilon() );
Expand Down
4 changes: 2 additions & 2 deletions js/phase-changes/view/EpsilonControlPotentialGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @author Siddhartha Chinthapally (Actual Concepts)
*/

import Property from '../../../../axon/js/Property.js';
import Multilink from '../../../../axon/js/Multilink.js';
import Bounds2 from '../../../../dot/js/Bounds2.js';
import Utils from '../../../../dot/js/Utils.js';
import merge from '../../../../phet-core/js/merge.js';
Expand Down Expand Up @@ -159,7 +159,7 @@ class EpsilonControlPotentialGraph extends PotentialGraphNode {
} );

// Update the graph when the substance or interaction strength changes.
Property.multilink(
Multilink.multilink(
[ phaseChangesModel.substanceProperty, phaseChangesModel.adjustableAtomInteractionStrengthProperty ],
substance => {
this.interactionEnabled = substance === SubstanceType.ADJUSTABLE_ATOM;
Expand Down
5 changes: 3 additions & 2 deletions js/phase-changes/view/PhaseChangesScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import createObservableArray from '../../../../axon/js/createObservableArray.js';
import DerivedProperty from '../../../../axon/js/DerivedProperty.js';
import Multilink from '../../../../axon/js/Multilink.js';
import Property from '../../../../axon/js/Property.js';
import Bounds2 from '../../../../dot/js/Bounds2.js';
import Range from '../../../../dot/js/Range.js';
Expand Down Expand Up @@ -111,7 +112,7 @@ class PhaseChangesScreenView extends ScreenView {
this.addChild( heaterCoolerNode );

// control when the heater/cooler node is enabled for input
Property.multilink(
Multilink.multilink(
[ model.isPlayingProperty, model.isExplodedProperty ],
( isPlaying, isExploded ) => {
if ( !isPlaying || isExploded ) {
Expand Down Expand Up @@ -340,7 +341,7 @@ class PhaseChangesScreenView extends ScreenView {
} );

// Update layout based on the visibility and bounds of the various control panels and accordion boxes.
Property.multilink(
Multilink.multilink(
[ this.phaseDiagramAccordionBox.visibleProperty, moleculesControlPanel.boundsProperty ],
( phaseDiagramVisible, moleculeControlPanelBounds ) => {
if ( isPotentialGraphEnabled ) {
Expand Down
4 changes: 2 additions & 2 deletions js/states/view/StatesScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @author Siddhartha Chinthapally (Actual Concepts)
*/

import Property from '../../../../axon/js/Property.js';
import Multilink from '../../../../axon/js/Multilink.js';
import merge from '../../../../phet-core/js/merge.js';
import Bounds2 from '../../../../dot/js/Bounds2.js';
import Vector2 from '../../../../dot/js/Vector2.js';
Expand Down Expand Up @@ -79,7 +79,7 @@ class StatesScreenView extends ScreenView {
this.addChild( heaterCoolerNode );

// control when the heater/cooler node is enabled for input
Property.multilink(
Multilink.multilink(
[ multipleParticleModel.isPlayingProperty, multipleParticleModel.isExplodedProperty ],
( isPlaying, isExploded ) => {
if ( !isPlaying || isExploded ) {
Expand Down

0 comments on commit 2c26506

Please sign in to comment.