function lissajou()
% Lissajoufiguren mittels Phasenshift zeichnen
% dazugehoerige Programme: lissasub.m 

% Vorlesung Applikationssoftware in der Physik I WS 98/99
% Cornelia Pein

global faktor1 faktor2 nframes phimax

% Figure festlegen
fig=figure(1);
% clear current figure
clf;
% Position
set(fig,'Position',[150 60 500 500],'Resize','on'); %'Tag','fig');

% ------------------ Achsen ---------------------------

ax1 = axes('Parent',fig,'position',[0.52 0.0 0.2 0.005],...
  'Color',get(fig,'Color'),'Tag','axes1');
ax2 = axes('Parent',fig,'position',[0.01 0.32 0.13 0.01],...
   'Color',get(gcf,'Color'),'Tag','axes2');
hauptax = axes('Parent',fig,'position',[0.18 0.18 0.75 0.75],...
	 'NextPlot','replacechildren','Tag','hauptax');
  
  
  
% ------------ diverse Faktoren ------------------

% maximale Genauigkeit: 1: x-Achse 2:y-Achse
% 1/genau musz eine ganze Zahl ergeben!
genau1 = 0.25; faktor1=1/genau1;
genau2 = 0.25; faktor2=1/genau2;
% Grenzen fuer die beiden Achsen
min1=1;max1=2;min2=1;max2=4;

nframes=25;
phimax=2;

%------------------ Menu's ---------------------

% Menu machen...
menu1=uimenu('Parent',fig,'Label','Movie','Tag','menu1');
menu11 = uimenu('Parent',menu1,'Callback','lissasub setframe','Label','Frameanzahl...','Tag','menu11');

% Menu machen...
menu2=uimenu('Parent',fig,'Label','Online-Rechendauer','Tag','menu2');
menu21 = uimenu('Parent',menu2,'Callback','lissasub setphi','Label','Rechendauer...','Tag','menu21');



% Make the first plot

axes(hauptax);
%axis off;
w1=1;
w2=1;
x=sin(w1*[0:pi/100:2*pi]);
y=sin(w2*[pi/2:pi/100:5*pi/2]);
h=plot(x,y,'Tag','lisa');
%set(0,'ShowHiddenHandles','on');
%axis manual;
axis([-1.1 1.1 -1.1 1.1]);
title('Lissajoufiguren mittels Phasenshift','Fontsize',18);



%-----------Slider 1 (X) ---------------------------------
% Slider 1 Control  x-Achse
slider1 = uicontrol(...
   'Style','slider','Tag','slider1', ...
   'Min',min1,'Max',max1,'Value',w1,...
   'SliderStep',[genau1/(max1-min1) genau1/(max1-min1)*2], ...
   'Callback','lissasub textw1',...
   'Units','normalized', ...
   'Position',[0.4 0.06 0.4 0.03] ...
   );

%Dummyachsen fuer die Sliderbeschriftung
axes(ax1);
axis off;
title(['\omega_1=',num2str(w1)]);


% Slidergrenzen beschriften Minimum
text1 = uicontrol( ...
   'Style','text', ...
   'FontSize',6, ...
   'String',num2str(min1), ...
   'BackgroundColor',get(fig,'Color'), ...
   'Units','normalized', ...
   'Position',[0.43 0.095 0.02 0.03] ...
   );

% Slidergrenzen beschriften Maximum
text2 = uicontrol( ...
   'Style','text', ...
   'FontSize',6, ...
   'String',num2str(max1), ...
   'BackgroundColor',get(fig,'Color'),...  %get(ax1,'Color'), ...
   'Units','normalized', ...
   'Position',[0.75 0.095 0.02 0.03] ...
   );
 
 
%------------ Slider 2 (Y) ------------------------------- 
% Slider 2 Control
slider2 = uicontrol(...
   'Style','slider','Tag','slider2', ...
   'Min',min2,'Max',max2,'Value',w2,...
   'SliderStep',[genau2/(max2-min2) genau2/(max2-min2)*4], ...
   'Callback','lissasub textw2',...
   'Units','normalized', ...
   'Position',[0.05 0.4 0.03 0.4] ...
   );


% Grenzen beschriften
text3 = uicontrol( ...
   'Style','text', ...
   'FontSize',9, ...
   'String',num2str(max2),...
   'BackgroundColor',get(fig,'Color'), ...
   'Units','normalized', ...
   'Position',[0.02 0.735 0.02 0.03] ...
   );


% Grenzen beschriften
text4 = uicontrol( ...
   'Style','text', ...
   'FontSize',9, ...
   'String',num2str(min2),...
   'BackgroundColor',get(fig,'Color'), ...
   'Units','normalized', ...
   'Position',[0.02 0.43 0.02 0.03] ...
   );


% Dummy-Achsen für die Slider-Beschriftung
axes(ax2);
axis off;
title(['\omega_2=',num2str(w2)]);

%---------------------- Buttons------------------------

%  Start Button Control
button1 = uicontrol('Interruptible','off','BusyAction','cancel',...
   'Style','pushbutton','Tag','button1', ...
   'Callback','lissasub rechnen', ...
   'String','Start',...
   'FontSize',14,...
   'Units','normalized', ...
   'Position',[0.03 0.08 0.13 0.05] ...
   );


%  Ende Button Control
button2 = uicontrol('BusyAction','cancel',...
   'Style','pushbutton','Tag','button2', ...
   'Callback','close', ...
   'String','Ende',...
   'FontSize',14,...
   'Units','normalized', ...
   'Position',[0.17 0.08 0.13 0.05] ...
   );

%  Movie Button Control
button3 = uicontrol('Interruptible','off','BusyAction','cancel',...
   'Style','pushbutton','Tag','button3', ...
   'Callback','lissasub lismovie', ...
   'String','M o o o v i e ...',...
   'FontSize',14,...
   'Units','normalized', ...
   'Position',[0.03 0.02 0.27 0.05] ...
   );

axes(hauptax);