|
OpenASIP 2.2
|
#include <UnitFigure.hh>


Public Member Functions | |
| UnitFigure () | |
| virtual | ~UnitFigure () |
| void | setName (const wxString &name) |
| void | setInfo (const wxString &info) |
Public Member Functions inherited from Figure | |
| Figure () | |
| virtual | ~Figure () |
| wxPoint | location () const |
| void | setLocation (wxPoint point) |
| void | setX (int x) |
| void | setY (int y) |
| void | setPreferredX (int x) |
| bool | xSet () const |
| void | clearXSetFlag () |
| virtual wxRect | bounds () const |
| virtual wxRect | virtualBounds () const |
| void | setBounds (wxSize bounds) |
| void | setWidth (int width) |
| void | setHeight (int height) |
| virtual void | addChild (Figure *child) |
| int | childCount () const |
| Figure * | child (int index) const |
| virtual void | draw (wxDC *dc) |
| void | highlight (const wxColour &colour) |
| void | clearHighlight () |
| void | setOptions (MachineCanvasOptions *options) |
| MachineCanvasOptions * | options () |
Protected Member Functions | |
| virtual void | layout (wxDC *) |
| virtual void | layoutSelf (wxDC *) |
| virtual void | layoutChildren (wxDC *) |
| virtual void | drawSelf (wxDC *) |
Protected Member Functions inherited from Figure | |
| void | drawChildren (wxDC *dc) |
Private Member Functions | |
| UnitFigure & | operator= (UnitFigure &old) |
| Assignment not allowed. | |
| UnitFigure (UnitFigure &old) | |
| Copying not allowed. | |
Private Attributes | |
| wxString | type_ |
| Type identifier of the unit. | |
| wxString | name_ |
| Name of the unit. | |
| wxString | info_ |
| Extra information string describing the unit. | |
Static Private Attributes | |
| static const wxColour | DEFAULT_COLOUR = wxColour(0, 0, 0) |
| Default colour for the figure. | |
| static const wxColour | DEFAULT_BG_COLOUR = wxColour(255, 255, 255) |
| Default background colour for the figure. | |
| static const wxColour | DEFAULT_INFO_TEXT_COLOUR = wxColour(150, 150, 150) |
| Default info string colour for the figure. | |
| static const int | MARGIN = 5 |
| Top and bottom margin in pixels. | |
| static const int | SPACING = 5 |
| Space between text rows in pixels. | |
Additional Inherited Members | |
Protected Attributes inherited from Figure | |
| wxPoint | location_ |
| Top-left location of the Figure's bounding rectangle. | |
| wxSize | size_ |
| wxSize of the Figure's bounding rectangle. | |
| wxSize | minSize_ |
| Figure's minimum size. | |
| std::vector< Figure * > | children_ |
| Figure's children. | |
| bool | xSet_ |
| Tells if x-coordinate has been fixed. | |
| bool | laidOut_ |
| Tells whether the Figure and its children have been laid out or not. | |
| bool | drawn_ |
| Tells whether the Figure and its children have been drawn or not. | |
| wxColour | highlight_ |
| Highlight colour. | |
| bool | highlighted_ |
| Tells if the figure is highlighted. | |
| MachineCanvasOptions * | options_ |
| Options which are used for customizing figures. | |
Figure of a unit.
Definition at line 46 of file UnitFigure.hh.
| UnitFigure::UnitFigure | ( | ) |
The Constructor.
Definition at line 60 of file UnitFigure.cc.
References Figure::minSize_, Figure::size_, MachineCanvasLayoutConstraints::UNIT_HEIGHT, and MachineCanvasLayoutConstraints::UNIT_WIDTH.
|
virtual |
|
private |
Copying not allowed.
|
protectedvirtual |
Draws the function unit's Figure on the given device context.
| dc | The device context. |
Reimplemented from Figure.
Definition at line 80 of file UnitFigure.cc.
References DEFAULT_BG_COLOUR, DEFAULT_COLOUR, DEFAULT_INFO_TEXT_COLOUR, Figure::highlight_, Figure::highlighted_, info_, OptionValue::isFlagOn(), Figure::location_, MARGIN, name_, Figure::options(), Options::optionValue(), MachineCanvasOptions::SHOW_UNIT_INFO_STRING, Figure::size_, SPACING, and type_.

|
protectedvirtual |
Lays the figure out.
Figure of the unit is laid out before it's children, so that the port Y-coordinate can be set correctly when laying out the ports.
| dc | Device cotnext to lay the figure out on. |
Reimplemented from Figure.
Definition at line 336 of file UnitFigure.cc.
References Figure::laidOut_, layoutChildren(), and layoutSelf().

|
protectedvirtual |
Lays out the ports to the bottom of the fu's Figure, spaced evenly.
| dc | Device context. |
Reimplemented from Figure.
Definition at line 196 of file UnitFigure.cc.
References assert, Figure::bounds(), Figure::child(), Figure::childCount(), Figure::children_, Figure::location_, UnitPortFigure::name(), MachineCanvasLayoutConstraints::PORT_SPACE, and Figure::size_.
Referenced by layout().

|
protectedvirtual |
Calculates and sets the size of the unit.
Depends on its name and the amount of ports.
| dc | Device context. |
Reimplemented from Figure.
Definition at line 350 of file UnitFigure.cc.
References Figure::children_, info_, OptionValue::isFlagOn(), MARGIN, MachineCanvasLayoutConstraints::MAX_UNIT_NAME_WIDTH, Figure::minSize_, name_, Figure::options(), Options::optionValue(), MachineCanvasLayoutConstraints::PORT_SPACE, MachineCanvasLayoutConstraints::PORT_WIDTH, MachineCanvasOptions::SHOW_UNIT_INFO_STRING, Figure::size_, SPACING, and type_.
Referenced by layout().

|
private |
Assignment not allowed.
| void UnitFigure::setInfo | ( | const wxString & | info | ) |
Sets the information string of the unit.
| info | New info string.. |
Definition at line 323 of file UnitFigure.cc.
References info_.
Referenced by FUFactory::createEditPart(), GCUFactory::createEditPart(), IUFactory::createEditPart(), and RFFactory::createEditPart().
| void UnitFigure::setName | ( | const wxString & | name | ) |
Sets the name of the unit.
| name | New name. |
Definition at line 304 of file UnitFigure.cc.
Referenced by FUFactory::createEditPart(), GCUFactory::createEditPart(), IUFactory::createEditPart(), and RFFactory::createEditPart().
|
staticprivate |
Default background colour for the figure.
Definition at line 76 of file UnitFigure.hh.
Referenced by drawSelf().
|
staticprivate |
Default colour for the figure.
Definition at line 74 of file UnitFigure.hh.
Referenced by drawSelf().
|
staticprivate |
Default info string colour for the figure.
Definition at line 78 of file UnitFigure.hh.
Referenced by drawSelf().
|
private |
Extra information string describing the unit.
Definition at line 71 of file UnitFigure.hh.
Referenced by drawSelf(), layoutSelf(), and setInfo().
|
staticprivate |
Top and bottom margin in pixels.
Definition at line 80 of file UnitFigure.hh.
Referenced by drawSelf(), and layoutSelf().
|
private |
Name of the unit.
Definition at line 69 of file UnitFigure.hh.
Referenced by drawSelf(), layoutSelf(), and setName().
|
staticprivate |
Space between text rows in pixels.
Definition at line 82 of file UnitFigure.hh.
Referenced by drawSelf(), and layoutSelf().
|
private |
Type identifier of the unit.
Definition at line 67 of file UnitFigure.hh.
Referenced by drawSelf(), layoutSelf(), and setName().