%
%  Abgel. Klasse für Strecken-Objekte
%
%  >> r = ShLine( 10, 8 )
%  >> r.draw;
%
classdef ShLine < Shape
  properties (Access = private)
    lenX = 0;
    lenY = 0;
  end
    
  methods
    function obj = ShLine(lenX,lenY)
      obj@Shape(0,0); 
      obj.lenX = lenX;
      obj.lenY = lenY;
      obj.hnd = [];
    end
    
    function disp( obj )
      disp@Shape(obj);
      fprintf( 'lenX = %g, lenY = %g \n', obj.lenX, obj.lenY );
    end
  
    function draw( obj )      
      clear( obj );    % Methode von Shape
      % Koordinaten 
      x = [obj.x, obj.x + obj.lenX];
      y = [obj.y, obj.y + obj.lenY];
      % Plotten und MATLAB Handle merken 
      obj.hnd = plot( x,y );           
      axis( [x(1)-5,x(2)+5,y(1)-5,y(2)+5] );
    end
    
  end
end