00001 /* rotatedrawer -- rotates the type of object doing drawing 00002 Copyright (C) 2002 Aaron Bentley 00003 00004 This program is free software; you can redistribute it and/or modify 00005 it under the terms of the GNU General Public License as published by 00006 the Free Software Foundation; either version 2, or (at your option) 00007 any later version. 00008 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 GNU General Public License for more details. 00013 00014 You should have received a copy of the GNU General Public License 00015 along with this program; if not, write to the Free Software Foundation, 00016 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 00017 class RotateDrawer: public visitor::DrawerVisitor 00018 { 00019 private: 00020 TreeView &tv; 00021 void do_visit(DarkFirst &source) 00022 { 00023 tv.setDrawer(new Drawer(tv.get_window())); 00024 } 00025 void do_visit(PrettyDrawer &source) 00026 { 00027 tv.setDrawer(new DarkFirst(tv.get_window())); 00028 } 00029 void do_visit(Drawer &source) 00030 { 00031 tv.setDrawer(new PrettyDrawer(tv.get_window())); 00032 } 00033 00034 public: 00035 RotateDrawer(TreeView &atv) 00036 : 00037 tv(atv) 00038 {} 00039 }; 00040