OpenASIP
2.0
|
#include <ConnectTool.hh>
Public Member Functions | |
ConnectTool (ChildFrame *frame, MDFView *view) | |
virtual | ~ConnectTool () |
virtual void | activate () |
virtual void | deactivate () |
virtual void | onMouseEvent (wxMouseEvent &event, wxDC &dc) |
virtual Figure * | figure () |
Public Member Functions inherited from MachineCanvasTool | |
virtual | ~MachineCanvasTool () |
Private Member Functions | |
void | updateStatusline (EditPart *part) |
void | leftClick (EditPart *part) |
void | rightClick (wxMouseEvent &event) |
Private Attributes | |
ChildFrame * | frame_ |
Parent frame of the canvas. More... | |
MDFView * | view_ |
View displayed on the Canvas. More... | |
bool | active_ |
Tells if the tool is active or not. More... | |
EditPart * | source_ |
Source EditPart of the connection. More... | |
EditPart * | target_ |
Target EditPart of the connection. More... | |
Figure * | figure_ |
Connection figure. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from MachineCanvasTool | |
MachineCanvasTool (MachineCanvas *canvas) | |
Protected Attributes inherited from MachineCanvasTool | |
MachineCanvas * | canvas_ |
Machine canvas where the tool is used. More... | |
Mouse tool for creating and removing connections between ports, sockets and bus segments.
Definition at line 47 of file ConnectTool.hh.
ConnectTool::ConnectTool | ( | ChildFrame * | frame, |
MDFView * | view | ||
) |
The Constructor.
Definition at line 57 of file ConnectTool.cc.
|
virtual |
|
virtual |
Activates the tool.
Implements MachineCanvasTool.
Definition at line 84 of file ConnectTool.cc.
References active_, and MachineCanvasTool::canvas_.
|
virtual |
Deactivates the tool.
Implements MachineCanvasTool.
Definition at line 95 of file ConnectTool.cc.
References active_, and MachineCanvasTool::canvas_.
|
virtual |
Returns the tool Figure.
Reimplemented from MachineCanvasTool.
Definition at line 269 of file ConnectTool.cc.
References MachineCanvasTool::canvas_, EditPart::figure(), figure_, MachineCanvas::hasEditPart(), TTAMachine::Port::isConnectedTo(), TTAMachine::Socket::isConnectedTo(), EditPart::model(), source_, and target_.
|
private |
Selects Component at cursor position, if there is a selectable EditPart at the coordinates.
part | Component to select. |
Definition at line 201 of file ConnectTool.cc.
References EditPart::canHandle(), MachineCanvasTool::canvas_, MDFView::clearSelection(), ComponentCommand::Do(), Model::notifyObservers(), EditPart::performRequest(), Model::popFromStack(), Model::pushToStack(), MachineCanvas::select(), MDFView::selection(), source_, target_, and view_.
Referenced by onMouseEvent().
|
virtual |
Handles mouse events on the Canvas.
event | Mouse event to handle. |
dc | Device context. |
Implements MachineCanvasTool.
Definition at line 108 of file ConnectTool.cc.
References active_, EditPart::canHandle(), MachineCanvasTool::canvas_, MachineCanvas::findEditPart(), MachineCanvas::findEditPartsInRange(), leftClick(), MachineCanvas::refreshToolFigure(), rightClick(), MachineCanvas::selection(), source_, target_, and updateStatusline().
|
private |
Pops a context menu when the right mouse button is clicked on the canvas.
event | Mouse event containing the cursor location where to pop the menu. |
Definition at line 240 of file ConnectTool.cc.
References MDFView::canvas(), ProDeConstants::CMD_NAME_PASTE, ProDeConstants::CMD_NAME_REDO, ProDeConstants::CMD_NAME_UNDO, ProDeConstants::COMMAND_PASTE, ProDeConstants::COMMAND_REDO, ProDeConstants::COMMAND_SELECT, ProDeConstants::COMMAND_UNDO, CommandRegistry::isEnabled(), and view_.
Referenced by onMouseEvent().
|
private |
Sends a status request to the given EditPart and executes the returned command.
Definition at line 179 of file ConnectTool.cc.
References EditPart::canHandle(), ComponentCommand::Do(), frame_, EditPart::performRequest(), ChildFrame::setStatus(), and Request::STATUS_REQUEST.
Referenced by onMouseEvent().
|
private |
Tells if the tool is active or not.
Definition at line 65 of file ConnectTool.hh.
Referenced by activate(), deactivate(), and onMouseEvent().
|
private |
Connection figure.
Definition at line 71 of file ConnectTool.hh.
Referenced by figure(), and ~ConnectTool().
|
private |
Parent frame of the canvas.
Definition at line 61 of file ConnectTool.hh.
Referenced by updateStatusline().
|
private |
Source EditPart of the connection.
Definition at line 67 of file ConnectTool.hh.
Referenced by figure(), leftClick(), and onMouseEvent().
|
private |
Target EditPart of the connection.
Definition at line 69 of file ConnectTool.hh.
Referenced by figure(), leftClick(), and onMouseEvent().
|
private |
View displayed on the Canvas.
Definition at line 63 of file ConnectTool.hh.
Referenced by leftClick(), and rightClick().