%
%  Name: vpsetup
% 
%  Usage: vpsetup
% 
%   Description:
%     Sets up the figure window for the comparative
%     viewports
%
%     Called by diamond.m
%

%
%  Version SWD970623
%
%  Author(s): Scott W. Doebling, doebling@lanl.gov
%
%  Institution: Los Alamos National Laboratory,
%		ESA-EA
%
%  Copyright (c) 1997, The Regents of the University
%     	of California. (See top level of code for
%	full copyright statement.)

%  Define the figure window

hvpfig = figure('units','normal','position',[0 0 0.95 0.95],...
   'resize','on','visible','off','menubar','none',...
   'numbertitle','off','name','DIAMOND: Comparative Viewports');

%  Define the graphics and legend axes for each viewport

hvpdataax(1) = axes('position',[0.05 0.60 0.4 0.3],'visible','off');
hvplegax(1) = axes('position',[0.05 0.5 0.4 0.05],'visible','off');
hvpinfobut(1) = uicontrol('position',[0.45 0.90 0.10 0.05],'style','pushbutton',...
   'string','Plot Info','callback','set(hvpinfofig,''visible'',''on'')');
hvplabel(1) = uicontrol('position',[0.15 0.91 0.20 0.025],'style','text',...
   'string','VIEWPORT 1');

hvpdataax(2) = axes('position',[0.55 0.60 0.4 0.3],'visible','off');
hvplegax(2) = axes('position',[0.55 0.5 0.4 0.05],'visible','off');
hvplabel(2) = uicontrol('position',[0.65 0.91 0.20 0.025],'style','text',...
   'string','VIEWPORT 2');

hvpdataax(3) = axes('position',[0.05 0.1 0.4 0.3],'visible','off');
hvplegax(3) = axes('position',[0.05 0.0 0.4 0.05],'visible','off');
hvplabel(3) = uicontrol('position',[0.15 0.41 0.20 0.025],'style','text',...
   'string','VIEWPORT 3');

hvpdataax(4) = axes('position',[0.55 0.1 0.4 0.3],'visible','off');
hvplegax(4) = axes('position',[0.55 0.0 0.4 0.05],'visible','off');
hvplabel(4) = uicontrol('position',[0.65 0.41 0.20 0.025],'style','text',...
   'string','VIEWPORT 4');

%  Define hide button

uicontrol('position',[0.45 0.05 0.1 0.05],'style','pushbutton',...
   'string','Hide','callback','set(hvpfig,''visible'',''off'')')

uicontrol('position',[0.45 0.1 0.1 0.05],'style','pushbutton',...
   'string','Clear All',...
   'callback',[...
      'clear vpinfostr,',...
      'for i = 1:4,',...
         'axes(hvpdataax(i)), cla reset, axis off,',...
         'axes(hvplegax(i)), cla reset, axis off,',...
         'set(hvpinfotext(i),''value'',1),',...
         'set(hvpinfotext(i),''string'','' ''),',...
      'end'])

%  ALL DONE