#include <forbiddenPatternManager.hpp>
Collaboration diagram for ForbiddenPatternManager:
Public Member Functions | |
ForbiddenPatternManager (MainController *controller) | |
Constructor. | |
virtual | ~ForbiddenPatternManager () |
Destructor. | |
void | setView (ForbiddenPatternView *view) |
Sets the forbidden pattern view. | |
void | newFP (int width, int height) |
Creates a new pattern and adds it to the collection. | |
void | newFP (ForbiddenPattern *fp) |
Adds a pattern to the collection. | |
void | FPSelected (unsigned int FPId) |
Selects a pattern. | |
void | cellChanged (int x, int y) |
Changes the status of a cell of the pattern. | |
void | removeFP () |
Deletes the pattern currently selected. | |
bool | saveFile () |
Saves the pattern collection to a file. | |
bool | saveFileAs () |
Saves the pattern collection to a file. | |
void | openFile () |
Opens a file containing forbidden patterns. | |
bool | openPFile (wxString file) |
Deletes all the patterns of the collection and opens a file. | |
bool | saveFilename (wxString file) |
Saves the collection to the file. | |
wxArrayString | getFPList () |
Returns a string list of the patterns of the collection. | |
ForbiddenPattern * | getFP (unsigned int id) |
Pattern access. | |
bool | isModified () |
Modified status. | |
wxString | getFileName () |
Member accessor. | |
void | clean () |
Resets the controller. | |
bool | checkPatterns () |
Checks the validity of the pattern collection. | |
Private Member Functions | |
void | updateGrids (bool changed) |
Updates the grid of the view to the current FP. | |
void | updateList () |
Updates the pattern list for the view. | |
bool | appendFPs (bool mustDeleteFPs, bool newFile) |
Appends the patterns of a file to the collection. | |
void | deleteFPs () |
Deletes all the patterns of the collection. | |
Private Attributes | |
FileManagerView | fileView |
File manager view for filesystem interaction. | |
ForbiddenPatternDiskManager * | diskManager |
Data persistance class. | |
ForbiddenPatternView * | view |
Presentation class. | |
MainController * | controller |
Main application controller. | |
wxString | fileName |
Current filename for the forbidden patterns. | |
bool | modified |
Has the forbidden pattern collection been modified without saving? | |
bool | needNewFile |
Do I need a file name to save the forbidden pattern collection? | |
map< unsigned int, ForbiddenPattern * > | FPList |
Collection of forbidden patterns. | |
unsigned int | nextId |
Next identifier to be used for the coming forbidden pattern. | |
unsigned int | currentFP |
Forbidden pattern currently in use. |
This class is the main controller for forbidden patterns. It manages the forbidden pattern view, manages the forbidden pattern collection of the system, provides services to the other controllers regarding forbidden patterns, and manages the disk persistance class.
Definition at line 48 of file forbiddenPatternManager.hpp.
|
Constructor.
Definition at line 29 of file forbiddenPatternManager.cpp. References controller, currentFP, diskManager, fileName, modified, needNewFile, and nextId. |
|
Destructor.
Definition at line 42 of file forbiddenPatternManager.cpp. References diskManager. |
|
Appends the patterns of a file to the collection. This method asks the user for a pattern file to be opened and, after deleting the patterns of the collection depending on a parameter, adds the patterns of the file to the collection. This method is called when the user wants to open a pattern file from the pattern view.
Definition at line 369 of file forbiddenPatternManager.cpp. References controller, currentFP, deleteFPs(), diskManager, MainController::elementChanged(), fileName, fileView, FPSelected(), modified, FileManagerView::openFileChoose(), ForbiddenPatternDiskManager::openFPs(), ForbiddenPatternView::selectFP(), updateList(), and view. Here is the call graph for this function: ![]() |
|
Changes the status of a cell of the pattern. It changes the status of the cell at coordinates x and y. The status graph is ENABLED->DISABLED->DON'T CARE->ENABLED
Definition at line 65 of file forbiddenPatternManager.cpp. References controller, currentFP, MainController::elementChanged(), FPList, modified, and updateGrids(). Referenced by ForbiddenPatternView::OnClick(). Here is the call graph for this function: ![]() |
|
Checks the validity of the pattern collection.
Definition at line 498 of file forbiddenPatternManager.cpp. References FPList. Referenced by ForbiddenPatternView::OnCheck(). |
|
Resets the controller. Deletes all the patterns and resets all the members. Used when creating a new project. Definition at line 481 of file forbiddenPatternManager.cpp. References controller, currentFP, deleteFPs(), MainController::elementChanged(), fileName, MainController::FPsChanged(), FPSelected(), modified, ForbiddenPatternView::selectFP(), updateList(), and view. Referenced by MainController::newFile(). Here is the call graph for this function: ![]() |
|
Deletes all the patterns of the collection.
Definition at line 328 of file forbiddenPatternManager.cpp. References controller, currentFP, MainController::elementChanged(), FPList, and nextId. Referenced by appendFPs(), clean(), openFile(), and openPFile(). Here is the call graph for this function: ![]() |
|
Selects a pattern.
Definition at line 135 of file forbiddenPatternManager.cpp. References currentFP, and updateGrids(). Referenced by appendFPs(), clean(), newFP(), ForbiddenPatternView::OnSelection(), and openPFile(). Here is the call graph for this function: ![]() |
|
Member accessor.
Definition at line 445 of file forbiddenPatternManager.cpp. References fileName. Referenced by MainController::save(), and MainController::saveFileNames(). |
|
Pattern access.
Definition at line 544 of file forbiddenPatternManager.cpp. References FPList. Referenced by LayoutManager::getListFPEnabled(). |
|
Returns a string list of the patterns of the collection.
Definition at line 418 of file forbiddenPatternManager.cpp. References FPList. Referenced by LayoutManager::FPsChanged(). |
|
Modified status.
Definition at line 435 of file forbiddenPatternManager.cpp. References modified. Referenced by MainController::open(). |
|
Adds a pattern to the collection.
Definition at line 403 of file forbiddenPatternManager.cpp. References controller, currentFP, MainController::elementChanged(), FPList, MainController::FPsChanged(), modified, and nextId. Here is the call graph for this function: ![]() |
|
Creates a new pattern and adds it to the collection.
Definition at line 96 of file forbiddenPatternManager.cpp. References controller, currentFP, MainController::elementChanged(), fileName, FPList, MainController::FPsChanged(), FPSelected(), modified, needNewFile, nextId, ForbiddenPatternView::selectFP(), ForbiddenPatternView::updateGrids(), updateList(), and view. Referenced by ForbiddenPatternView::OnNew(), and ForbiddenPatternDiskManager::returnFPs(). Here is the call graph for this function: ![]() |
|
Opens a file containing forbidden patterns. The user is asked to select the file. Definition at line 283 of file forbiddenPatternManager.cpp. References deleteFPs(), FPList, modified, ForbiddenPatternView::msgYesNo(), saveFile(), and view. Referenced by ForbiddenPatternView::OnOpen(). Here is the call graph for this function: ![]() |
|
Deletes all the patterns of the collection and opens a file. This method is used when a new project is opened. The controller must delete all the patterns before opening the ones in the file.
Definition at line 344 of file forbiddenPatternManager.cpp. References controller, currentFP, deleteFPs(), diskManager, MainController::elementChanged(), fileName, FPSelected(), ForbiddenPatternDiskManager::openFPs(), ForbiddenPatternView::selectFP(), updateList(), and view. Here is the call graph for this function: ![]() |
|
Deletes the pattern currently selected.
Definition at line 143 of file forbiddenPatternManager.cpp. References currentFP, and FPList. Referenced by ForbiddenPatternView::OnRemove(). |
|
Saves the pattern collection to a file. If the pattern collection has been saved previously it's saved on the same file. If not, the user is asked to enter a file name to save the collection to.
Definition at line 191 of file forbiddenPatternManager.cpp. References diskManager, fileName, fileView, FPList, modified, needNewFile, FileManagerView::saveFileChoose(), ForbiddenPatternDiskManager::saveFPs(), and view. Referenced by ForbiddenPatternView::OnSave(), openFile(), MainController::save(), and MainController::saveAs(). Here is the call graph for this function: ![]() |
|
Saves the pattern collection to a file. The user is asked to enter a file name to save the collection to.
Definition at line 241 of file forbiddenPatternManager.cpp. References fileName, fileView, FPList, FileManagerView::saveFileChoose(), and view. Referenced by ForbiddenPatternView::OnSaveAs(). Here is the call graph for this function: ![]() |
|
Saves the collection to the file.
Definition at line 456 of file forbiddenPatternManager.cpp. References FPList. Referenced by MainController::save(). |
|
Sets the forbidden pattern view.
Definition at line 52 of file forbiddenPatternManager.cpp. References view. |
|
Updates the grid of the view to the current FP.
Definition at line 80 of file forbiddenPatternManager.cpp. References currentFP, FPList, ForbiddenPatternView::updateGrids(), and view. Referenced by cellChanged(), and FPSelected(). Here is the call graph for this function: ![]() |
|
Updates the pattern list for the view.
Definition at line 121 of file forbiddenPatternManager.cpp. References FPList. Referenced by appendFPs(), clean(), newFP(), and openPFile(). |
|
Main application controller.
Definition at line 79 of file forbiddenPatternManager.hpp. Referenced by appendFPs(), cellChanged(), clean(), deleteFPs(), ForbiddenPatternManager(), newFP(), and openPFile(). |
|
Forbidden pattern currently in use.
Definition at line 91 of file forbiddenPatternManager.hpp. Referenced by appendFPs(), cellChanged(), clean(), deleteFPs(), ForbiddenPatternManager(), FPSelected(), newFP(), openPFile(), removeFP(), and updateGrids(). |
|
Data persistance class.
Definition at line 75 of file forbiddenPatternManager.hpp. Referenced by appendFPs(), ForbiddenPatternManager(), openPFile(), saveFile(), and ~ForbiddenPatternManager(). |
|
Current filename for the forbidden patterns.
Definition at line 81 of file forbiddenPatternManager.hpp. Referenced by appendFPs(), clean(), ForbiddenPatternManager(), getFileName(), newFP(), openPFile(), saveFile(), and saveFileAs(). |
|
File manager view for filesystem interaction.
Definition at line 73 of file forbiddenPatternManager.hpp. Referenced by appendFPs(), saveFile(), and saveFileAs(). |
|
Collection of forbidden patterns.
Definition at line 87 of file forbiddenPatternManager.hpp. Referenced by cellChanged(), checkPatterns(), deleteFPs(), getFP(), getFPList(), newFP(), openFile(), removeFP(), saveFile(), saveFileAs(), saveFilename(), updateGrids(), and updateList(). |
|
Has the forbidden pattern collection been modified without saving?
Definition at line 83 of file forbiddenPatternManager.hpp. Referenced by appendFPs(), cellChanged(), clean(), ForbiddenPatternManager(), isModified(), newFP(), openFile(), and saveFile(). |
|
Do I need a file name to save the forbidden pattern collection?
Definition at line 85 of file forbiddenPatternManager.hpp. Referenced by ForbiddenPatternManager(), newFP(), and saveFile(). |
|
Next identifier to be used for the coming forbidden pattern.
Definition at line 89 of file forbiddenPatternManager.hpp. Referenced by deleteFPs(), ForbiddenPatternManager(), and newFP(). |
|
Presentation class.
Definition at line 77 of file forbiddenPatternManager.hpp. Referenced by appendFPs(), clean(), newFP(), openFile(), openPFile(), saveFile(), saveFileAs(), setView(), and updateGrids(). |