Mercurial > hg > ltpda
view m-toolbox/classes/@plotterFactory/plotterFactory.m @ 52:daf4eab1a51e database-connection-manager tip
Fix. Default password should be [] not an empty string
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 07 Dec 2011 17:29:47 +0100 |
parents | f0afece42f48 |
children |
line wrap: on
line source
% PLOTTERFACTORY factory constructor for different plotter objects. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % DESCRIPTION: PLOTTERFACTORY factory constructor for different plotter objects. % % CONSTRUCTOR: % % p = plotterFactory.makePlotter(objects) % % % VERSION: $Id: plotterFactory.m,v 1.2 2011/04/08 08:56:38 hewitson Exp $ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% classdef plotterFactory methods (Abstract=true) dummy(varargin); % dummy abstract method to ensure this factory can't be instantiated end methods (Static=true) function p = makePlotter(varargin) obj_cl = class(varargin{1}); objs = utils.helper.collect_objects(varargin(:), obj_cl); switch obj_cl case 'ao' dcl = class(objs(1).data); % Check if all the ao.data objects are of the same class; if not, % we return an aoplotter. for kk=1:numel(objs) obj = objs(kk); if ~strcmp(class(obj.data), dcl) warning('Object [%s] has a different data type to object [%s]; returning a default aoplotter'); p = aoplotter(objs); return end end % Otherwise go on and attempt to build a more specialised plotter switch dcl case 'tsdata' p = tsplotter(objs); otherwise p = aoplotter(objs); warning('I don''t know how to make a plotter for %s/%s data objects; returning a default plotter', obj_cl, dcl); end otherwise error('I don''t know how to make a plotter for %s objects', cl); end % End switch on object class end % End makePlotter end % End static methods block end % END