LayoutView Class Reference

Presentation layer class for spaces. More...

#include <layoutView.hpp>

Collaboration diagram for LayoutView:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LayoutView (wxWindow *parent, wxWindowID id, LayoutManager *controller)
 Constructor.
virtual ~LayoutView ()
 Destructor.
void updateGrids (Grid grid, bool changed)
 Updates the space canvas.
void OnNew (wxCommandEvent &event)
 New space button click event.
void OnSave (wxCommandEvent &event)
 Save button click event.
void OnSaveAs (wxCommandEvent &event)
 Save As button click event.
void OnOpen (wxCommandEvent &event)
 Open space button click event.
void OnClick (LayoutCanvasEvent &event)
 Space canvas click event.
void updateTTList (map< wxString, bool > tables)
 Updates the truth table checklistbox.
void updateFPList (map< unsigned int, bool > FPs)
 Updates the forbidden pattern checklistbox.
void updateRuleList (map< unsigned int, bool > rules)
 Updates the rule checklistbox.
void updateInputList (wxArrayString strings)
 Updates the input listbox.
void updateOutputList (wxArrayString strings)
 Updates the output listbox.
void selectTable (wxString table)
 Selects a truth table.
void errorMsg (wxString message)
 Shows an error message.
bool msgYesNo (wxString message)
 Shows a yes/no selection dialog.
void OnTableSelected (wxCommandEvent &event)
 Truth table checklistbox selection event.
void OnInputSelected (wxCommandEvent &event)
 Input listbox selection event.
void OnOutputSelected (wxCommandEvent &event)
 Output listbox selection event.
void OnTableChecked (wxCommandEvent &event)
 Truth table checklistbox check event.
void OnRuleChecked (wxCommandEvent &event)
 Rule checklistbox check event.
void OnFPChecked (wxCommandEvent &event)
 Forbidden pattern checklistbox check event.
void OnAssignInput (wxCommandEvent &event)
 Assign input button click event.
void OnAssignOutput (wxCommandEvent &event)
 Assign output button click event.
void OnPrepare (wxCommandEvent &event)
 Prepare simulation button click event.
void OnStart (wxCommandEvent &event)
 Start simulation button click event.
void onlyAssign (bool enable)
 Customizes the view for the assigning mode.
void OnKeyPressed (wxKeyEvent &event)
 Key press event.
void updateCanvas ()
 Refreshes the canvas window.
void updateInputs (vector< coordinate > inputs)
 Sets the assigned inputs on the canvas.
void updateOutputs (vector< coordinate > outputs)
 Sets the assigned outputs on the canvas.
void checkTable (wxString table, bool enabled)
 Checks or unchecks a truth table.
void checkRule (wxString rule, bool enabled)
 Checks or unchecks a rule.
void checkFP (wxString FP, bool enabled)
 Checks or unchecks a pattern.
void enableCheckSimulation (bool enable)
 Enables or disables the prepare simulation button.
void enableStartSimulation (bool enable)
 Enables or disables the start simulation button.

Private Member Functions

void initControls ()
 Control initialization.
void initSizers ()
 Sizers (window layout) initialization.

Private Attributes

LayoutManagercontroller
wxStaticText * labelTitle
wxBitmapButton * buttonNew
wxBitmapButton * buttonOpen
wxBitmapButton * buttonSave
wxBitmapButton * buttonSaveAs
wxBitmapButton * buttonAssignInput
wxBitmapButton * buttonAssignOutput
wxButton * buttonPrepareSimulation
wxButton * buttonStartSimulation
wxCheckListBox * listTables
wxCheckListBox * listRules
wxCheckListBox * listFPs
wxListBox * listInputs
wxListBox * listOutputs
LayoutCanvascanvas

Detailed Description

Presentation layer class for spaces.

This class manages a space view. It not only has to show the current space but the truth tables, rules and forbidden pattern so the user can select and unselect them, and also can assign the inputs and outputs of the truth tables to the space.

Author:
Bernat Rāfales Mulet <the_bell@users.sourceforge.net>
Version:
Revision
1.21

Definition at line 44 of file layoutView.hpp.


Constructor & Destructor Documentation

LayoutView::LayoutView wxWindow *  parent,
wxWindowID  id,
LayoutManager controller
 

Constructor.

Parameters:
parent the parent window.
id the window identifier.
controller the space controller.

Definition at line 76 of file layoutView.cpp.

LayoutView::~LayoutView  )  [virtual]
 

Destructor.

Definition at line 89 of file layoutView.cpp.


Member Function Documentation

void LayoutView::checkFP wxString  FP,
bool  enabled
 

Checks or unchecks a pattern.

Parameters:
FP the pattern.
enabled true if the pattern has to be checked, false if it has to be unchecked.

Definition at line 698 of file layoutView.cpp.

References listFPs.

void LayoutView::checkRule wxString  rule,
bool  enabled
 

Checks or unchecks a rule.

Parameters:
rule the rule.
enabled true if the rule has to be checked, false if it has to be unchecked.

Definition at line 686 of file layoutView.cpp.

References listRules.

void LayoutView::checkTable wxString  table,
bool  enabled
 

Checks or unchecks a truth table.

Parameters:
table the truth table.
enabled true if the table has to be checked, false if it has to be unchecked.

Definition at line 674 of file layoutView.cpp.

References listTables.

void LayoutView::enableCheckSimulation bool  enable  ) 
 

Enables or disables the prepare simulation button.

Parameters:
enable true if the button has to be enabled, false if it has to be disabled.

Definition at line 729 of file layoutView.cpp.

References buttonPrepareSimulation.

Referenced by LayoutManager::elementChanged(), and LayoutManager::enableSimulation().

void LayoutView::enableStartSimulation bool  enable  ) 
 

Enables or disables the start simulation button.

Parameters:
enable true if the button has to be enabled, false if it has to be disabled.

Definition at line 740 of file layoutView.cpp.

References buttonStartSimulation.

Referenced by LayoutManager::elementChanged(), and LayoutManager::enableSimulation().

void LayoutView::errorMsg wxString  message  ) 
 

Shows an error message.

Parameters:
message the error message.

Definition at line 402 of file layoutView.cpp.

Referenced by LayoutManager::saveFile().

void LayoutView::initControls  )  [private]
 

Control initialization.

Definition at line 95 of file layoutView.cpp.

References buttonAssignInput, buttonAssignOutput, buttonNew, buttonOpen, buttonPrepareSimulation, buttonSave, buttonSaveAs, buttonStartSimulation, canvas, ID_BUTTON_ASSIGNINPUT, ID_BUTTON_ASSIGNOUTPUT, ID_BUTTON_NEW, ID_BUTTON_OPEN, ID_BUTTON_PREPARE, ID_BUTTON_SAVE, ID_BUTTON_SAVEAS, ID_BUTTON_START, ID_CANVAS, ID_LISTFPS, ID_LISTINPUTS, ID_LISTOUTPUTS, ID_LISTRULES, ID_LISTTABLES, listFPs, listInputs, listOutputs, listRules, and listTables.

void LayoutView::initSizers  )  [private]
 

Sizers (window layout) initialization.

Definition at line 133 of file layoutView.cpp.

References buttonAssignInput, buttonAssignOutput, buttonNew, buttonOpen, buttonPrepareSimulation, buttonSave, buttonSaveAs, buttonStartSimulation, canvas, listFPs, listInputs, listOutputs, listRules, and listTables.

bool LayoutView::msgYesNo wxString  message  ) 
 

Shows a yes/no selection dialog.

Parameters:
message the question message.
Returns:
True if the user selected yes, false otherwise.

Definition at line 427 of file layoutView.cpp.

Referenced by LayoutManager::openFile().

void LayoutView::OnAssignInput wxCommandEvent &  event  ) 
 

Assign input button click event.

Parameters:
event the event.

Definition at line 514 of file layoutView.cpp.

References LayoutManager::assignInput(), canvas, controller, onlyAssign(), and LayoutCanvas::setVisible().

Here is the call graph for this function:

void LayoutView::OnAssignOutput wxCommandEvent &  event  ) 
 

Assign output button click event.

Parameters:
event the event.

Definition at line 528 of file layoutView.cpp.

References LayoutManager::assignOutput(), canvas, controller, onlyAssign(), and LayoutCanvas::setVisible().

Here is the call graph for this function:

void LayoutView::OnClick LayoutCanvasEvent event  ) 
 

Space canvas click event.

Parameters:
event the event.

Definition at line 217 of file layoutView.cpp.

References LayoutManager::cellChanged(), controller, LayoutCanvasEvent::getX(), and LayoutCanvasEvent::getY().

Here is the call graph for this function:

void LayoutView::OnFPChecked wxCommandEvent &  event  ) 
 

Forbidden pattern checklistbox check event.

Parameters:
event the event.

Definition at line 659 of file layoutView.cpp.

References controller, LayoutManager::FPChecked(), and listFPs.

Here is the call graph for this function:

void LayoutView::OnInputSelected wxCommandEvent &  event  ) 
 

Input listbox selection event.

Parameters:
event the event.

Definition at line 589 of file layoutView.cpp.

References controller, and LayoutManager::inputSelected().

Here is the call graph for this function:

void LayoutView::OnKeyPressed wxKeyEvent &  event  ) 
 

Key press event.

Parameters:
event the event.

Definition at line 575 of file layoutView.cpp.

References controller, and LayoutManager::escapePressed().

Here is the call graph for this function:

void LayoutView::onlyAssign bool  enable  ) 
 

Customizes the view for the assigning mode.

Disables everything but the canvas window and sets it to show only inputs or outputs.

Parameters:
enable true if the assigning mode has to be set, false if it has to be unset.

Definition at line 545 of file layoutView.cpp.

References buttonAssignInput, buttonAssignOutput, buttonNew, buttonOpen, buttonSave, buttonSaveAs, canvas, listFPs, listInputs, listOutputs, listRules, listTables, and LayoutCanvas::setVisible().

Referenced by LayoutManager::cellChanged(), LayoutManager::escapePressed(), OnAssignInput(), and OnAssignOutput().

Here is the call graph for this function:

void LayoutView::OnNew wxCommandEvent &  event  ) 
 

New space button click event.

Parameters:
event the event.

Definition at line 227 of file layoutView.cpp.

void LayoutView::OnOpen wxCommandEvent &  event  ) 
 

Open space button click event.

Parameters:
event the event.

Definition at line 416 of file layoutView.cpp.

References controller, and LayoutManager::openFile().

Here is the call graph for this function:

void LayoutView::OnOutputSelected wxCommandEvent &  event  ) 
 

Output listbox selection event.

Parameters:
event the event.

Definition at line 604 of file layoutView.cpp.

References controller, and LayoutManager::outputSelected().

Here is the call graph for this function:

void LayoutView::OnPrepare wxCommandEvent &  event  ) 
 

Prepare simulation button click event.

Parameters:
event the event.

Definition at line 708 of file layoutView.cpp.

References controller, and LayoutManager::prepareSimulation().

Here is the call graph for this function:

void LayoutView::OnRuleChecked wxCommandEvent &  event  ) 
 

Rule checklistbox check event.

Parameters:
event the event.

Definition at line 646 of file layoutView.cpp.

References controller, listRules, and LayoutManager::ruleChecked().

Here is the call graph for this function:

void LayoutView::OnSave wxCommandEvent &  event  ) 
 

Save button click event.

Parameters:
event the event.

Definition at line 441 of file layoutView.cpp.

References controller, and LayoutManager::saveFile().

Here is the call graph for this function:

void LayoutView::OnSaveAs wxCommandEvent &  event  ) 
 

Save As button click event.

Parameters:
event the event.

Definition at line 451 of file layoutView.cpp.

References controller, and LayoutManager::saveFileAs().

Here is the call graph for this function:

void LayoutView::OnStart wxCommandEvent &  event  ) 
 

Start simulation button click event.

Parameters:
event the event.

Definition at line 718 of file layoutView.cpp.

References controller, and LayoutManager::startSimulation().

Here is the call graph for this function:

void LayoutView::OnTableChecked wxCommandEvent &  event  ) 
 

Truth table checklistbox check event.

Parameters:
event the event.

Definition at line 474 of file layoutView.cpp.

References controller, listTables, and LayoutManager::tableChecked().

Here is the call graph for this function:

void LayoutView::OnTableSelected wxCommandEvent &  event  ) 
 

Truth table checklistbox selection event.

Parameters:
event the event.

Definition at line 461 of file layoutView.cpp.

References controller, and LayoutManager::tableSelected().

Here is the call graph for this function:

void LayoutView::selectTable wxString  table  ) 
 

Selects a truth table.

Parameters:
table the truth table to be selected.

Definition at line 388 of file layoutView.cpp.

References listTables.

void LayoutView::updateCanvas  ) 
 

Refreshes the canvas window.

Definition at line 616 of file layoutView.cpp.

References canvas, and LayoutCanvas::drawScene().

Referenced by LayoutManager::cellChanged(), and LayoutManager::tableSelected().

Here is the call graph for this function:

void LayoutView::updateFPList map< unsigned int, bool >  FPs  ) 
 

Updates the forbidden pattern checklistbox.

Parameters:
FPs the new pattern list and check status.

Definition at line 340 of file layoutView.cpp.

void LayoutView::updateGrids Grid  grid,
bool  changed
 

Updates the space canvas.

Parameters:
grid the new grid.
changed True if the new grid is from a new space, false if it's a status change of the same space.

Definition at line 306 of file layoutView.cpp.

References buttonSave, buttonSaveAs, canvas, and LayoutCanvas::setGrid().

Referenced by LayoutManager::clean(), LayoutManager::newLayout(), and LayoutManager::updateGrids().

Here is the call graph for this function:

void LayoutView::updateInputList wxArrayString  strings  ) 
 

Updates the input listbox.

Parameters:
strings the string list.

Definition at line 484 of file layoutView.cpp.

References buttonAssignInput, and listInputs.

void LayoutView::updateInputs vector< coordinate inputs  ) 
 

Sets the assigned inputs on the canvas.

Parameters:
inputs the assigned inputs.

Definition at line 626 of file layoutView.cpp.

References canvas, and LayoutCanvas::setAssignedInputs().

Referenced by LayoutManager::cellChanged(), LayoutManager::newLayout(), and LayoutManager::tableSelected().

Here is the call graph for this function:

void LayoutView::updateOutputList wxArrayString  strings  ) 
 

Updates the output listbox.

Parameters:
strings the string list.

Definition at line 499 of file layoutView.cpp.

References buttonAssignOutput, and listOutputs.

void LayoutView::updateOutputs vector< coordinate outputs  ) 
 

Sets the assigned outputs on the canvas.

Parameters:
outputs the assigned outputs.

Definition at line 636 of file layoutView.cpp.

References canvas, and LayoutCanvas::setAssignedOutputs().

Referenced by LayoutManager::cellChanged(), LayoutManager::newLayout(), and LayoutManager::tableSelected().

Here is the call graph for this function:

void LayoutView::updateRuleList map< unsigned int, bool >  rules  ) 
 

Updates the rule checklistbox.

Parameters:
rules the new table list and check status.

Definition at line 364 of file layoutView.cpp.

void LayoutView::updateTTList map< wxString, bool >  tables  ) 
 

Updates the truth table checklistbox.

Parameters:
tables the new table list and check status.

Definition at line 318 of file layoutView.cpp.


Member Data Documentation

wxBitmapButton* LayoutView::buttonAssignInput [private]
 

Definition at line 99 of file layoutView.hpp.

Referenced by initControls(), initSizers(), onlyAssign(), and updateInputList().

wxBitmapButton* LayoutView::buttonAssignOutput [private]
 

Definition at line 100 of file layoutView.hpp.

Referenced by initControls(), initSizers(), onlyAssign(), and updateOutputList().

wxBitmapButton* LayoutView::buttonNew [private]
 

Definition at line 95 of file layoutView.hpp.

Referenced by initControls(), initSizers(), and onlyAssign().

wxBitmapButton* LayoutView::buttonOpen [private]
 

Definition at line 96 of file layoutView.hpp.

Referenced by initControls(), initSizers(), and onlyAssign().

wxButton* LayoutView::buttonPrepareSimulation [private]
 

Definition at line 101 of file layoutView.hpp.

Referenced by enableCheckSimulation(), initControls(), and initSizers().

wxBitmapButton* LayoutView::buttonSave [private]
 

Definition at line 97 of file layoutView.hpp.

Referenced by initControls(), initSizers(), onlyAssign(), and updateGrids().

wxBitmapButton* LayoutView::buttonSaveAs [private]
 

Definition at line 98 of file layoutView.hpp.

Referenced by initControls(), initSizers(), onlyAssign(), and updateGrids().

wxButton* LayoutView::buttonStartSimulation [private]
 

Definition at line 102 of file layoutView.hpp.

Referenced by enableStartSimulation(), initControls(), and initSizers().

LayoutCanvas* LayoutView::canvas [private]
 

Definition at line 110 of file layoutView.hpp.

Referenced by initControls(), initSizers(), OnAssignInput(), OnAssignOutput(), onlyAssign(), updateCanvas(), updateGrids(), updateInputs(), and updateOutputs().

LayoutManager* LayoutView::controller [private]
 

Definition at line 89 of file layoutView.hpp.

Referenced by OnAssignInput(), OnAssignOutput(), OnClick(), OnFPChecked(), OnInputSelected(), OnKeyPressed(), OnOpen(), OnOutputSelected(), OnPrepare(), OnRuleChecked(), OnSave(), OnSaveAs(), OnStart(), OnTableChecked(), and OnTableSelected().

wxStaticText* LayoutView::labelTitle [private]
 

Definition at line 92 of file layoutView.hpp.

wxCheckListBox* LayoutView::listFPs [private]
 

Definition at line 107 of file layoutView.hpp.

Referenced by checkFP(), initControls(), initSizers(), OnFPChecked(), and onlyAssign().

wxListBox* LayoutView::listInputs [private]
 

Definition at line 108 of file layoutView.hpp.

Referenced by initControls(), initSizers(), onlyAssign(), and updateInputList().

wxListBox* LayoutView::listOutputs [private]
 

Definition at line 109 of file layoutView.hpp.

Referenced by initControls(), initSizers(), onlyAssign(), and updateOutputList().

wxCheckListBox* LayoutView::listRules [private]
 

Definition at line 106 of file layoutView.hpp.

Referenced by checkRule(), initControls(), initSizers(), onlyAssign(), and OnRuleChecked().

wxCheckListBox* LayoutView::listTables [private]
 

Definition at line 105 of file layoutView.hpp.

Referenced by checkTable(), initControls(), initSizers(), onlyAssign(), OnTableChecked(), and selectTable().


The documentation for this class was generated from the following files:
Generated on Fri Sep 1 23:58:39 2006 for NanoComp by  doxygen 1.4.6