www.gusucode.com > mbcview 工具箱matlab源码程序 > mbcview/@cgtradeoffgui/@toGVCell/toGVCell.m

    function obj = toGVCell(hGraphObject, varargin)
%TOGVCELL Constructor for toGVCell
%
%  OBJ = TOGVCELL(HOBJECT, PROP, VALUE, ...) creates a new instance of a
%  toGVCell. This graph object is designed to be used as part of the
%  tradeoff scrolling graphs object.  HOBJECT is the handle to a
%  tradeoffGraphView that is managing the graph grid.

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


if nargin>1 && isa(varargin{1}, 'cgtradeoffgui.toGVCell')
   obj = varargin{1};
   varargin(1) = [];
else
   obj = cgtradeoffgui.toGVCell;
end

% Call the inherited constructor
abstractcomponent(obj, varargin{:});

SC = xregGui.SystemColorsDbl;
obj.hAxesPanel = mbcgui.widget.AxesContainer(...
    'Parent', obj.Parent, ...
    'Visible', obj.Visible, ...
    'Border', [15 10 15 10]);
obj.hAxes = obj.hAxesPanel.AxesHandle;
set(obj.hAxes, ...
    'Units', 'pixels', ...
    'Box', 'on', ...
    'XGrid', 'on', ...
    'YGrid', 'on', ...
    'Layer', 'top', ...
    'XTickLabel', {}, ...
    'YTickLabel', {}, ...
    'Tag','TradeoffCrossSectionPlot',...
    'HitTest', 'off');



obj.hConstraints = xregGui.intervalPatch1D('parent', obj.hAxes, ...
    'facecolor', mbcbdrycolor);
obj.hConstraints.connect(obj, 'up');

obj.hModelLine = line('Parent', obj.hAxes, ...
    'HitTest', 'off', ...
    'XData', [], ...
    'YData', [], ...
    'Color', 'b');

obj.hErrorLine = line('Parent', obj.hAxes, ...
    'HitTest', 'off', ...
    'XData', [], ...
    'YData', [], ...
    'Color', 'b', ...
    'LineStyle', '--');

obj.hValueLine = line('Parent', obj.hAxes, ...
    'HandleVisibility', 'off', ...
    'XData', [], ...
    'YData', [], ...
    'LineWidth', 3, ...
    'Color', [1 0.5 0], ...
    'Clipping', 'off', ...
    'ButtonDownFcn', {@i_startvalueedit, obj});

obj.addPropertyListeners( ...
    'DisplayYAxisTickMarks', ...
    {@i_switchdisplayyaxis, obj.hAxesPanel});



function i_switchdisplayyaxis(~, evt, hAxPanel)
obj = evt.AffectedObject;
if obj.DisplayYAxisTickMarks
    leftborder = 35;
else
    leftborder = 15;
end
brd = [leftborder 10 15 10];
set(hAxPanel, 'Border', brd);


function i_startvalueedit(src, ~, obj)
obj.GraphView.pStartValueDrag(get(src, 'Parent'));