www.gusucode.com > mbcguitools 工具箱 matlab 源码程序 > mbcguitools/@mvgraph1d/get.m

    function out=get(gr,varargin)
%GET   GET interface for Graph1d object.
%  Implements get interface for graph1d object
%  Currently supported properties are:
%    'Position'
%    'Visible'
%    'Currentfactor'
%    'Data'
%    'Factors'
%    'Parent'
%    'Histogram'
%    'Histogramcolor'
%    'Histogrambars'
%    'Callback'
%
%  The following return a handle, allowing you to set handle graphics properties
%  (NOTE - this could break the object if you're not careful!)
%      'axes'
%      'line'
%      'text'
%      'popup'
%      'histogramaxes'
%      'histogrampatch'

%  Copyright 2000-2015 The MathWorks, Inc. and Ford Global Technologies, Inc.


% Bail if we've not been given a graph1d object
if ~isa(gr,'mvgraph1d')
    error(message('mbc:mvgraph1d:InvalidObject'))
end

ud = get(gr.axes, 'UserData');

% loop over varargin
for n=1:(nargin-1)
    switch lower(varargin{n})
        case 'position'
            out=ud.Position;      
        case 'visible'
            out = get(gr.panel,'Visible'); 
        case {'data','number','value'}
            out=ud.Data; 
        case 'factors'
            out=get(gr.factorsel,'String');
        case 'currentfactor'
            out=get(gr.factorsel,'Value');
        case 'histogram'
            if ud.HistOptions.Show
                out='on';
            else
                out='off';
            end
        case 'histogramcolor'
            out=ud.HistOptions.Colours;
        case 'histogrambars'
            out = ud.HistOptions.NumBars;
            if isempty(out)
                out='auto';
            end
        case 'limits'
            out = ud.Limits;
        case 'frame'
            if ud.HistOptions.Frame
                out = 'on';
            else
                out = 'off';
            end
        case 'axes'
            out=gr.axes;
        case 'line'
            out=gr.line;
        case 'text'
            out=gr.factortext;
        case 'popup'
            out=gr.factorsel;
        case 'parent'
            out=get(gr.panel,'Parent');
        case 'histogramaxes'
            out=gr.hist.axes;
        case 'histogrampatch'
            out=gr.hist.patch;
        case 'datatags'
            out = 'none';
        case 'customdatatags'
            out = {};
        case 'uicontextmenu'
            out = get(gr.panel,'UIContextMenu');  
        case 'callback'
            ud = get(gr.axes, 'UserData');
            out = ud.callback;
    end
end