Want more features on Pastebin? Sign Up, it's FREE!
Guest

Inheritance structure

By: vamsiampolu on Feb 15th, 2014  |  syntax: JavaScript  |  size: 1.03 KB  |  views: 60  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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.         };
clone this paste RAW Paste Data