phetsims / projectile-motion

"Projectile Motion" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
15 stars 13 forks source link

Create general Properties to control all mass/diameter NumberControls #260

Closed zepumph closed 3 years ago

zepumph commented 3 years ago

On the lab screen. In the projectile control panel, we want a single Property that would set all Projectile types's mass NumberControl visible. This will directly change the numberControl.visibleProperty.

We also want this for displayOnlyProperty (see https://github.com/phetsims/sun/issues/686#issuecomment-786268389), and enabledProperty.

From #244

Here are notes from today's PhET-iO meeting

Just for mass and diameter

baseball mass slider invisble
general mass sliders invisible
general mass sliders visible

A baseball mass slider visible <--------------------- do this (direct control)
B baseball mass slider invisible

This works:
general mass sliders invisible
basball mass sliders visible

CONSENSUS:
The top level Property makes sense to actually manipulate the specific visibleProperties, even though those are still instrumented.

Tagging @arouinfar and @kathy-phet

zepumph commented 3 years ago

The top level Property makes sense to actually manipulate the specific visibleProperties, even though those are still instrumented.

So there is a top level Property, and when it changes, it changes the individual NumberControl.visibleProperty for all object types.

This has been implemented above, see

projectileMotion.labScreen.view.projectileControlPanel.diameterNumberControlsVisibleProperty projectileMotion.labScreen.view.projectileControlPanel.massNumberControlsVisibleProperty

So the above Properties will actually set all the individual visibleProperties, like

projectileMotion.labScreen.view.projectileControlPanel.carControl.massNumberControl.visibleProperty

This means that you can have this case, which allows for complete flexibility:

This seems great to me.

I also added code so that the panel will resize when NumberControls are hidden here on the lab screen.

Please review.

zepumph commented 3 years ago

I created https://github.com/phetsims/projectile-motion/issues/270 to handle displayOnlyProperty.

arouinfar commented 3 years ago

Thanks @zepumph! I really like how things are behaving in master.