function axestable(h)

import javax.swing.*;

%% Method which builds/populates the axes table on the node panel

if isempty(h.Handles) || ~isfield(h.Handles,'PNLAxes') || isempty(h.Handles.PNLAxes) || ...
        ~ishandle(h.Handles.PNLAxes)
    return % No panel
end

%% Assemble the axes table data by traversing the axesgrid, finding its
%% position, and writing the corresponding row
if ~isempty(h.Plot)
    tableData = cell([h.Plot.AxesGrid.size(1),4]);
    for k=1:h.Plot.axesgrid.size(1)
        ylimmode = h.Plot.axesgrid.YlimMode{k};       
        ylims = h.Plot.Axesgrid.getylim(k);
        tableData(k,:) = {h.Plot.AxesGrid.RowLabel{k}, ...
            h.Plot.Axesgrid.YlimMode{k},ylims(1),ylims(2)};
    end
else % No axes yet since the timeplot does not exist - e.g. tsseriesview
     % created but not yet populated with a time series
    tableData = cell(0,4);
end

%% Populate the table - if necessary creating it
if ~isfield(h.Handles,'axesTable') || isempty(h.Handles.axesTable)
    headings = {'Title','Scaling','Ymin','Ymax'};
    [h.Handles.axesTable, h.Handles.PNLaxesTable] = ... 
        uitable(ancestor(h.Handles.PNLAxes,'figure'),tableData,headings);
    set(h.Handles.PNLaxesTable,'Parent',h.Handles.PNLAxes)
    % Single row select only
    awtinvoke(h.Handles.axesTable.getTable,'setSelectionMode',...
        ListSelectionModel.SINGLE_SELECTION);
    awtinvoke(h.Handles.axesTable.getTable,'setCellSelectionEnabled',false);
    awtinvoke(h.Handles.axesTable.getTable,'setRowSelectionAllowed',true);

    % Turn off the default uitable context menus
    mouseListeners = h.Handles.axesTable.getTable.getMouseListeners;
    for k=1:length(mouseListeners)
        if isa(mouseListeners(k), 'com.mathworks.widgets.spreadsheet.SpreadsheetTable$TableMouseEventListener')
            h.Handles.axesTable.getTable.removeMouseListener(mouseListeners(k));
        end
    end
    % Combo box editor for 2nd col
    h.Handles.axesTable.setComboBoxEditor({{'manual','auto'}},2);
    % DataChange listener
    set(h.Handles.axesTable,'DataChangedCallback',{@localDataChange ...
        h.Handles.axesTable h})   
else
    tstableSetData(h.Handles.axesTable,tableData)
end

%% Pack the table
awtinvoke(h.Handles.axesTable.getTable,'setAutoResizeMode',true)

function localDataChange(eventSrc, eventData, table, h)

%% Find the data which was changed
startRow = eventData.getEvent.getFirstRow+1;
endRow = eventData.getEvent.getLastRow+1;
col = eventData.getEvent.getColumn+1;

%% Get current table data
tableData = cell(table.Data);

%% Update the @timeplot
switch col
    case 1
        h.Plot.Axesgrid.RowLabel{startRow} = tableData{startRow,1};
    case 2
        Ylimmode = h.Plot.Axesgrid.YlimMode;
        Ylimmode{startRow} = tableData{startRow,2};
        h.Plot.Axesgrid.YlimMode = Ylimmode;
    case {3,4}
        for r=1:2
            if ischar(tableData{startRow,2+r})
                ylim(r) = str2num(tableData{startRow,2+r});
            else
                ylim(r) = tableData{startRow,2+r};
            end
        end
        h.Plot.Axesgrid.setylim(ylim,startRow);
end



