OpenASIP
2.0
|
#include <MDFView.hh>
Public Member Functions | |
MDFView () | |
virtual | ~MDFView () |
virtual bool | OnCreate (wxDocument *doc, long) |
virtual bool | OnClose (bool deleteWindow) |
virtual void | OnUpdate (wxView *sender, wxObject *hint) |
virtual void | OnDraw (wxDC *dc) |
void | clearSelection () |
EditPart * | selection () |
virtual void | OnActivateView (bool activate, wxView *activateView, wxView *deactivateView) |
virtual void | OnChangeFilename () |
virtual wxPrintout * | OnCreatePrintout () |
MachineCanvas * | canvas () const |
Private Member Functions | |
MDFView (const MDFView &) | |
Copying forbidden. More... | |
MDFView & | operator= (const MDFView &) |
Assignment forbidden. More... | |
Private Attributes | |
MachineCanvas * | canvas_ |
The window where the figures are drawn. More... | |
ChildFrame * | frame_ |
ChildFrame for displaying the view. More... | |
Viewing and editing component of a MDFDocument.
Part of the wxWidgets document/view framework. View of a Machine Object Model consists of EditParts defining the editing behaviour of the model components. For each EditPart in the view exists a figure defining the visualization of the component. The EditParts form a tree hierarchy starting from the top level contents EditPart, which is a child of the RootEditPart. This class also keeps track of the selected EditParts.
Definition at line 59 of file MDFView.hh.
MDFView::MDFView | ( | ) |
The Constructor.
Definition at line 60 of file MDFView.cc.
|
virtual |
|
private |
Copying forbidden.
MachineCanvas * MDFView::canvas | ( | ) | const |
Returns pointer to the MachineCanvas of the view.
Definition at line 229 of file MDFView.cc.
References canvas_.
Referenced by BridgeDialog::BridgeDialog(), ZoomOutCmd::Do(), FitWindowCmd::Do(), FitHeightCmd::Do(), ZoomInCmd::Do(), FitWidthCmd::Do(), SelectCmd::Do(), ToggleUnitDetailsCmd::Do(), EditConnectionsCmd::Do(), ToggleUnitDetailsCmd::isChecked(), BridgeDialog::onCancel(), BridgeDialog::onOK(), SelectTool::popContextMenu(), and ConnectTool::rightClick().
void MDFView::clearSelection | ( | ) |
Clears the component selection.
Definition at line 182 of file MDFView.cc.
References canvas_, and MachineCanvas::clearSelection().
Referenced by SelectCmd::Do(), EditConnectionsCmd::Do(), and ConnectTool::leftClick().
|
virtual |
Sets the main frame title when the view is activated.
Definition at line 191 of file MDFView.cc.
References ProDeConstants::EDITOR_NAME, OnChangeFilename(), and OnUpdate().
|
virtual |
Updates the main and child frame titles when the filename changes.
Definition at line 212 of file MDFView.cc.
References ProDeConstants::EDITOR_NAME, FileSystem::fileOfPath(), frame_, WxConversion::toString(), and WxConversion::toWxString().
Referenced by OnActivateView().
|
virtual |
Implements closing behaviour.
Closes the associated document.
deleteWindow | If true, deletes the frame associated with the view. |
Definition at line 83 of file MDFView.cc.
|
virtual |
Creates a ChildFrame and a Canvas for the document when a new view is created.
doc | Pointer to the document which this view visualizes. |
Definition at line 110 of file MDFView.cc.
References canvas_, frame_, and MachineCanvas::setTool().
|
virtual |
Creates printout of the machine figure.
Definition at line 251 of file MDFView.cc.
References canvas_.
|
virtual |
Handles paint events of the view.
dc | Device context to draw the machine on. |
Definition at line 240 of file MDFView.cc.
References canvas_, and MachineCanvas::OnDraw().
|
virtual |
Updates the model visualization.
sender | View that sent the update request, or NULL if no single view requested the update (for instance, when the document is opened). |
hint | Unused at the moment but may in future contain application-specific information for making updating more efficient. |
Definition at line 144 of file MDFView.cc.
References assert, canvas_, Model::getMachine(), MDFDocument::getModel(), machine, and MachineCanvas::setMachine().
Referenced by OnActivateView().
EditPart * MDFView::selection | ( | ) |
Returns selected component of the view.
Definition at line 169 of file MDFView.cc.
References canvas_, and MachineCanvas::selection().
Referenced by CopyComponentCmd::isEnabled(), CutComponentCmd::isEnabled(), DeleteComponentCmd::isEnabled(), ModifyComponentCmd::isEnabled(), and ConnectTool::leftClick().
|
private |
The window where the figures are drawn.
Definition at line 85 of file MDFView.hh.
Referenced by canvas(), clearSelection(), OnClose(), OnCreate(), OnCreatePrintout(), OnDraw(), OnUpdate(), and selection().
|
private |
ChildFrame for displaying the view.
Definition at line 87 of file MDFView.hh.
Referenced by OnChangeFilename(), OnClose(), and OnCreate().