Exemplo n.º 1
0
 this.positionListener = function() {
   var orientation = b.positionProperty.value.minus( a.positionProperty.value );
   if ( orientation.magnitude > 0 ) {
     orientation.normalize();
   }
   var location = orientation.times( a.covalentRadius ).plus( a.positionProperty.value );
   self.setTranslation( BAMConstants.MODEL_VIEW_TRANSFORM.modelToViewPosition( location ) );
 };
Exemplo n.º 2
0
  CollectionPanel.getCollectionPanelModelWidth = function( isSingleCollectionMode ) {
    // construct a dummy collection panel and check its width
    var collection = new KitCollection();
    collection.addCollectionBox( new CollectionBox( MoleculeList.H2O, 1 ) );
    var kitCollectionList = new KitCollectionList( collection, new LayoutBounds( false, 0 ), new Emitter() );
    var collectionPanel = new CollectionPanel( kitCollectionList, isSingleCollectionMode, [], function() { return Bounds2.NOTHING; } );

    return BAMConstants.MODEL_VIEW_TRANSFORM.viewToModelDeltaX( collectionPanel.width );
  };