You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: QueueViewerClass.m
    path of file: ./repos/automaticanalysis/aa_engine/aaq
    
    the code of the file until where you have to start completion: % Queue Viewer Tool
% USAGE:
%   QV = QueueViewerClass(scheduler)
%       - scheduler: scheduler initiated (e.g. via parcluster)
%       - QV: queue viewer object
%
% GUI:
%   Clicking on jobs on the list provides info about the job
%   Clicking on "Info..." button provides info about the scheduler
%   Clicking on "Kill all!" button kills all jobs
%   Clicking on "Close" button closes the viewer. You can reopen using the Open method (e.g. QV.Open)
%
% Updating the list of jobs:
%   It does not automaticaly update the list of jobs after launching, but
%   you can update the list manually by clicking on the "Update" button or
%   calling the Update method (e.g. QV.Update). It also means that the the
%   program does not hold the focus, so you can continue working with MATLAB!
%
%   You can also switch on auto update by clicking on the "Auto update"
%   checkbox. With auto update swicthed on, you can set the update rate
%   using the slider. Keep in mind however, that in auto update mode, the
%   program holds the focus, so you cannot use MATLAB!
%
% Tibor Auer MRC CBU Cambridge 2012-2015

classdef QueueViewerClass < handle
    properties
        OnScreen
        Hold = true
    end
    properties (Access = protected)
        Pool
        DisplayHelper
        
        UIControls
                
        UpdateRate = 10
        Clock = []
    end
    properties (Access = private)
        JobsToIgnore = []
    end
    
    methods
        function obj = QueueViewerClass(pool)
            obj.Pool = pool;
            try
                obj.DisplayHelper = parallel.internal.display.DisplayHelper('Task');
            catch E
                if strcmp(E.identifier,'MATLAB:invalidType'), obj.DisplayHelper = parallel.internal.display.DisplayHelper(4);
                else rethrow(E); end
            end
            obj.Open;
        end
        
%         function delete(obj)
%             obj.Pool = [];
%         end
        
        function Open(obj)
            FontSize = [1.7*get(0,'DefaultUicontrolFontSize') get(0,'DefaultUicontrolFontSize')*0.8]; % H W
            DefaultListSize = [60 300]; % H W
            
            ncControls = 3; % #columns
            nrControls = 3; % #rows
            
            q = obj.GetQueue;
            
            [H, W] = size(char(q));
            
            % from listdlg
            fus = 8;
            ffs = 8;
            uh = 22; % Control Height
            
            figname = 'Queue';
            promptstring = {['Active jobs at ' datestr(now)]};
            listsize = [max([W*FontSize(2) DefaultListSize(2)]) max([H*FontSize(1) DefaultListSize(1)])];
            liststring = cellstr(q);
            initialvalue = 1;
            ex = FontSize(1);
            
            fp = get(0,'DefaultFigurePosition');
            w = 2*(fus+ffs)+listsize(1);
            h = 2*ffs+(5+nrControls)*fus+ex*numel(promptstring)+listsize(2)+nrControls*uh;
            fp = [fp(1) fp(2)+fp(4)-h w h];  % keep upper left corner fixed
            
            fig_props = { ...
                'name'                   figname ...
                'color'                  get(0,'DefaultUicontrolBackgroundColor') ...
                'resize'                 'off' ...
                'numbertitle'            'off' ...
                'menubar'                'none' ...
                'windowstyle'            'normal' ...
                'visible'                'off' ...
                'createfcn'              ''    ...
                'position'               fp   ...
                'closerequestfcn'        'delete(gcbf)' ...
                };
            obj.UIControls.fig = figure(fig_props{:});
            
            obj.UIControls.prompt_text = uicontrol('Style','text','String',promptstring,...
                'HorizontalAlignment','left',...
                'Position',[ffs+fus fp(4)-(ffs+fus+ex*numel(promptstring)) ...
                listsize(1) ex*numel(promptstring)]);
            
            obj.UIControls.listbox = uicontrol('Style','listbox',...
                'Position',[ffs+fus ffs+nrControls*uh+(3+nrControls)*fus listsize],...
                'String',liststring,...
                'BackgroundColor','w',...
                'Max',1,...
                'Tag','listbox',...
                'Value',initialvalue, ...
                'Callback', {@doListboxClick,obj});
            
            control_wid = (fp(3)-ncControls*(ffs+fus)-fus)/ncControls;
            
            pos = [1 1];
            obj.UIControls.autoupdate_lbl1 = uicontrol('Style','text','String','Autoupdate:',...
                'HorizontalAlignment','left',...
                'Position',[ffs+fus+(pos(2)-1)*(fus+control_wid) ffs+(nrControls-pos(1)+1)*fus+(nrControls-pos(1))*uh control_wid uh]);
            
            pos = [1 2];
            obj.UIControls.autoupdate_chk = uicontrol('Style','checkbox',...
                'Position',[ffs+fus+(pos(2)-1)*(fus
    
function delete(obj)
%             obj.Pool = [];
%         end
        
        function Open(obj)
            FontSize = [1.7*get(0,'DefaultUicontrolFontSize') get(0,'DefaultUicontrolFontSize')*0.8]; % H W
            DefaultListSize = [60 300]; % H W
            
            ncControls = 3; % #columns
            nrControls = 3; % #rows
            
            q = obj.GetQueue;
            
            [H, W] = size(char(q));
            
            % from listdlg
            fus = 8;
            ffs = 8;
            uh = 22; % Control Height
            
            figname = 'Queue';
            promptstring = {['Active jobs at ' datestr(now)]};
            listsize = [max([W*FontSize(2) DefaultListSize(2)]) max([H*FontSize(1) DefaultListSize(1)])];
            liststring = cellstr(q);
            initialvalue = 1;
            ex = FontSize(1);
            
            fp = get(0,'DefaultFigurePosition');
            w = 2*(fus+ffs)+listsize(1);
            h = 2*ffs+(5+nrControls)*fus+ex*numel(promptstring)+listsize(2)+nrControls*uh;
            fp = [fp(1) fp(2)+fp(4)-h w h];  % keep upper left corner fixed
            
            fig_props = { ...
                'name'                   figname ...
                'color'                  get(0,'DefaultUicontrolBackgroundColor') ...
                'resize'                 'off' ...
                'numbertitle'            'off' ...
                'menubar'                'none' ...
                'windowstyle'            'normal' ...
                'visible'                'off' ...
                'createfcn'              ''    ...
                'position'               fp   ...
                'closerequestfcn'        'delete(gcbf)' ...
                };
            obj.UIControls.fig = figure(fig_props{:});
            
            obj.UIControls.prompt_text = uicontrol('Style','text','String',promptstring,...
                'HorizontalAlignment','left',...
                'Position',[ffs+fus fp(4)-(ffs+fus+ex*numel(promptstring)) ...
                listsize(1) ex*numel(promptstring)]);
            
            obj.UIControls.listbox = uicontrol('Style','listbox',...
                'Position',[ffs+fus ffs+nrControls*uh+(3+nrControls)*fus listsize],...
                'String',liststring,...
                'BackgroundColor','w',...
                'Max',1,...
                'Tag','listbox',...
                'Value',initialvalue, ...
                'Callback', {@doListboxClick,obj});
            
            control_wid = (fp(3)-ncControls*(ffs+fus)-fus)/ncControls;
            
            pos = [1 1];
            obj.UIControls.autoupdate_lbl1 = uicontrol('Style','text','String','Autoupdate:',...
                'HorizontalAlignment','left',...
                'Position',[ffs+fus+(pos(2)-1)*(fus+control_wid) ffs+(nrControls-pos(1)+1)*fus+(nrControls-pos(1))*uh control_wid uh]);
            
            pos = [1 2];
            obj.UIControls.autoupdate_chk = uicontrol('Style','checkbox',...
                'Position',[ffs+fus+(pos(2)-1)*(fus+control_wid) ffs+(nrControls-pos(1)+1)*fus+(nrControls-pos(1))*uh control_wid uh],...
                'Tag','autoupdate_chk',...
                'Callback',{@chkAutoUpdate,obj});
            
            pos = [2 1];
            obj.UIControls.autoupdate_lbl2 = uicontrol('Style','text','String','Update rate:',...
                'Visible','off',...
                'HorizontalAlignment','left',...
                'Position',[ffs+fus+(pos(2)-1)*(fus+control_wid) ffs+(nrControls-pos(1)+1)*fus+(nrControls-pos(1))*uh control_wid uh]);
            
            pos = [2 2];
            obj.UIControls.autoupdate_sld = uicontrol('Style','slider',...
                'Visible','off',...
                'Min',10,'Max',24*3600,'Value',10,...
                'SliderStep',[10/(24*3600-10) 60/(24*3600-10)],...
                'Position',[ffs+fus+(pos(2)-1)*(fus+control_wid) ffs+(nrControls-pos(1)+1)*fus+(nrControls-pos(1))*uh control_wid*2 uh],...
                'Tag','autoupdate_sld',...
                'Callback',{@sldAutoUpdate,obj});
            
            pos = [1 3];
            obj.UIControls.update_btn = uicontrol('Style','pushbutton',...
                'String','Update',...
                'Position',[ffs+fus+(pos(2)-1)*(fus+control_wid) ffs+(nrControls-pos(1)+1)*fus+(nrControls-pos(1))*uh control_wid uh],...
                'Tag','update_btn',...
                'Callback',{@doUpdate,obj});
            
            pos = [3 1]; % row, column
            info_btn = uicontrol('Style','pushbutton',...
                'String','Info...',...
                'Position',[ffs+fus+(pos(2)-1)*(fus+control_wid) ffs+(nrControls-pos(1)+1)*fus+(nrControls-pos(1))*uh control_wid uh],...
                'Tag','info_btn',...
                'Callback',{@doInfo,obj});
            
            pos = [3 2];
            killall_btn = uicontrol('Style','pushbutton',...
                'String','Kill all!',...
                'Position',[ffs+fus+(pos(2)-1)*(fus+control_wid) ffs+(nrControls-pos(1)+1)*fus+(nrControls-pos(1))*uh control_wid uh],...
                'Tag','killall_btn',...
                'Callback',{@doKillAll,obj});
            
            pos = [3 3];
            close_btn = uicontrol('Style','pushbutton',...
                'String','Close',...
                'Position',[ffs+fus+(pos(2)-1)*(fus+control_wid) ffs+(nrControls-pos(1)+1)*fus+(nrControls-pos(1))*uh control_wid uh],...
                'Tag','close_btn',...
                'Callback',{@doClose,obj});
            
            set(obj.UIControls.fig, 'Visible','on'); drawnow;
            obj.OnScreen = true;
            obj.Hold = false;
        end