/* * Project: MoleCuilder * Description: creates and alters molecular systems * Copyright (C) 2010 University of Bonn. All rights reserved. * Please see the LICENSE file or "Copyright notice" in builder.cpp for details. */ /* * CommandLineWindow.cpp * * Created on: May 8, 2010 * Author: heber */ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include "CodePatterns/MemDebug.hpp" #include #include "CommandLineUI/CommandLineWindow.hpp" #include "CommandLineUI/CommandLineStatusIndicator.hpp" #include "CodePatterns/Log.hpp" #include "CodePatterns/Verbose.hpp" #include "Actions/Action.hpp" #include "Actions/ActionRegistry.hpp" #include "UIElements/CommandLineUI/CommandLineParser.hpp" #include using namespace std; // TODO: see what code can be moved to a base class for Graphic and CommandLine Windows CommandLineWindow::CommandLineWindow() { // Add status indicators etc... statusIndicator = new CommandLineStatusIndicator(); } CommandLineWindow::~CommandLineWindow() { delete statusIndicator; } void CommandLineWindow::display() { //cout << ActionRegistry::getInstance(); // go through all possible actions DoLog(0) && (Log() << Verbose(0) << "Calling Actions ... " << std::endl); for (std::list::iterator CommandRunner = CommandLineParser::getInstance().SequenceOfActions.begin(); CommandRunner != CommandLineParser::getInstance().SequenceOfActions.end(); ++CommandRunner) { if (ActionRegistry::getInstance().isActionPresentByName(*CommandRunner)) { DoLog(1) && (Log() << Verbose(1) << "Checking presence of " << *CommandRunner << ": " << "calling " << *CommandRunner << endl); ActionRegistry::getInstance().getActionByName(*CommandRunner)->call(); } else { DoLog(1) && (Log() << Verbose(1) << "Checking presence of " << *CommandRunner << ": " << "absent." << endl); } } }