Advertisement
vamsiampolu

Inheritance structure

Feb 15th, 2014
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var createRectangle=function createRectangle(strokeColor,strokeWeight,strokeOpacity,fillColor,fillOpacity)
  2.     {
  3.         configurePolygonOptions.apply(this,[strokeColor,strokeWeight,strokeOpacity,fillColor,fillOpacity]);
  4.     };
  5.  
  6.     createRectangle.prototype=Object.create(configurePolygonOptions.prototype);
  7.     createRectangle.prototype.constructor=createRectangle;
  8.  
  9.     createRectangle.prototype.setBounds=function(bounds)
  10.     {
  11.         console.log('setting bounds');
  12.         this.bounds=bounds;
  13.     };
  14.  
  15.     var configureCircle=function configureCircle(strokeColor,strokeWeight,strokeOpacity,fillColor,fillOpacity)
  16.     {
  17.         configurePolygonOptions.apply(this,[strokeColor,strokeWeight,strokeOpacity,fillColor,fillOpacity]);
  18.         //configurePolygonOptions.call(this);
  19.     };
  20.  
  21.     configureCircle.prototype=Object.create(configurePolygonOptions.prototype);
  22.     configureCircle.prototype.constructor=configureCircle;
  23.  
  24.     configureCircle.prototype.setCenter=function(center)
  25.     {
  26.         this.center=center;
  27.     };
  28.  
  29.     configureCircle.prototype.setRadius=function(radius)
  30.     {
  31.         this.radius=radius;
  32.     };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement