Skip to content

Commit

Permalink
Instrument control panel, see #83
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisklus committed Apr 22, 2019
1 parent fe2c670 commit b30e311
Show file tree
Hide file tree
Showing 2 changed files with 420 additions and 5 deletions.
18 changes: 13 additions & 5 deletions js/blackbody-spectrum/view/BlackbodySpectrumControlPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ define( function( require ) {
touchAreaYDilation: BUTTON_TOUCH_DILATION,
listener: function() {
model.saveMainBody();
}
},
tandem: options.tandem.createTandem( 'saveButton' )
} );

// Erase button
Expand All @@ -100,7 +101,8 @@ define( function( require ) {
touchAreaYDilation: BUTTON_TOUCH_DILATION,
listener: function() {
model.clearSavedGraphs();
}
},
tandem: options.tandem.createTandem( 'eraseButton' )
} );

// Makes the eraseButton enabled when there is a saved graph to clear, and disabled when there is no graph to clear
Expand All @@ -113,9 +115,15 @@ define( function( require ) {
checkboxColorBackground: CONTROL_PANEL_FILL,
checkboxColor: CHECKBOX_COLOR
};
var valuesCheckbox = new Checkbox( valuesCheckboxText, model.graphValuesVisibleProperty, checkboxOptions );
var intensityCheckbox = new Checkbox( intensityCheckboxText, model.intensityVisibleProperty, checkboxOptions );
var labelsCheckbox = new Checkbox( labelsCheckboxText, model.labelsVisibleProperty, checkboxOptions );
var valuesCheckbox = new Checkbox( valuesCheckboxText, model.graphValuesVisibleProperty,
_.assign( checkboxOptions, { tandem: options.tandem.createTandem( 'graphValuesCheckbox' ) } )
);
var intensityCheckbox = new Checkbox( intensityCheckboxText, model.intensityVisibleProperty,
_.assign( checkboxOptions, { tandem: options.tandem.createTandem( 'intensityCheckbox' ) } )
);
var labelsCheckbox = new Checkbox( labelsCheckboxText, model.labelsVisibleProperty,
_.assign( checkboxOptions, { tandem: options.tandem.createTandem( 'labelsCheckbox' ) } )
);

valuesCheckbox.touchArea = valuesCheckbox.localBounds.dilated( CHECKBOX_TOUCH_DILATION );
intensityCheckbox.touchArea = intensityCheckbox.localBounds.dilated( CHECKBOX_TOUCH_DILATION );
Expand Down
Loading

0 comments on commit b30e311

Please sign in to comment.