Skip to content

Commit

Permalink
Instrument panels, see #83
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisklus committed Mar 14, 2019
1 parent d3500e3 commit f4a32a2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
7 changes: 6 additions & 1 deletion js/blackbody-spectrum/view/BlackBodySpectrumControlPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ define( function( require ) {
var RichText = require( 'SCENERY/nodes/RichText' );
var ScientificNotationNode = require( 'SCENERY_PHET/ScientificNotationNode' );
var StringUtils = require( 'PHETCOMMON/util/StringUtils' );
var Tandem = require( 'TANDEM/Tandem' );
var Text = require( 'SCENERY/nodes/Text' );
var VBox = require( 'SCENERY/nodes/VBox' );

Expand Down Expand Up @@ -76,7 +77,11 @@ define( function( require ) {
resize: true,
stroke: BlackbodyColorProfile.panelStrokeProperty,
minWidth: DEFAULT_WIDTH,
maxWidth: DEFAULT_WIDTH
maxWidth: DEFAULT_WIDTH,

// phet-io
tandem: Tandem.required,
phetioDocumentation: '',
}, options );

// create the text nodes
Expand Down
9 changes: 7 additions & 2 deletions js/blackbody-spectrum/view/BlackbodySpectrumScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,13 @@ define( function( require ) {
phetioDocumentation: 'button that resets the screen to its initial state'
} );

var controlPanel = new BlackBodySpectrumControlPanel( model );
var savedInformationPanel = new SavedGraphInformationPanel( model, { minWidth: controlPanel.width } );
var controlPanel = new BlackBodySpectrumControlPanel( model, {
tandem: tandem.createTandem( 'controlPanel' )
} );
var savedInformationPanel = new SavedGraphInformationPanel( model, {
minWidth: controlPanel.width,
tandem: tandem.createTandem( 'savedGraphsPanel' )
} );

// REVIEW: I think it would make a little more sense for the addChild()s to happen after the node positioning, but
// perhaps it doesn't matter. If you make the change, follow the same pattern in the other few cases in this sim.
Expand Down
11 changes: 9 additions & 2 deletions js/blackbody-spectrum/view/SavedGraphInformationPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ define( function( require ) {
var Path = require( 'SCENERY/nodes/Path' );
var PhetColorScheme = require( 'SCENERY_PHET/PhetColorScheme' );
var PhetFont = require( 'SCENERY_PHET/PhetFont' );
var Tandem = require( 'TANDEM/Tandem' );
var Text = require( 'SCENERY/nodes/Text' );
var Util = require( 'DOT/Util' );
var VBox = require( 'SCENERY/nodes/VBox' );
Expand All @@ -41,7 +42,11 @@ define( function( require ) {
labelOptions: {
font: new PhetFont( 16 ),
fill: BlackbodyColorProfile.titlesTextProperty
}
},

// phet-io
tandem: Tandem.required,
phetioDocumentation: 'panel that contains saved blackbody temperatures',
}, options );

// The labels for all of the graphs' information
Expand Down Expand Up @@ -93,7 +98,9 @@ define( function( require ) {
minWidth: options.minWidth,
align: 'left',
yMargin: 10,
xMargin: 10
xMargin: 10,
tandem: options.tandem,
phetioDocumentation: options.phetioDocumentation
} );

// A small local function that takes in a temperature and formats it consistently
Expand Down

0 comments on commit f4a32a2

Please sign in to comment.