OpenASIP
2.0
|
#include <Figure.hh>
Public Member Functions | |
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 | layout (wxDC *dc) |
virtual void | draw (wxDC *dc) |
void | highlight (const wxColour &colour) |
void | clearHighlight () |
void | setOptions (MachineCanvasOptions *options) |
MachineCanvasOptions * | options () |
Protected Member Functions | |
virtual void | drawSelf (wxDC *dc) |
void | drawChildren (wxDC *dc) |
virtual void | layoutSelf (wxDC *) |
virtual void | layoutChildren (wxDC *) |
Protected Attributes | |
wxPoint | location_ |
Top-left location of the Figure's bounding rectangle. More... | |
wxSize | size_ |
wxSize of the Figure's bounding rectangle. More... | |
wxSize | minSize_ |
Figure's minimum size. More... | |
std::vector< Figure * > | children_ |
Figure's children. More... | |
bool | xSet_ |
Tells if x-coordinate has been fixed. More... | |
bool | laidOut_ |
Tells whether the Figure and its children have been laid out or not. More... | |
bool | drawn_ |
Tells whether the Figure and its children have been drawn or not. More... | |
wxColour | highlight_ |
Highlight colour. More... | |
bool | highlighted_ |
Tells if the figure is highlighted. More... | |
MachineCanvasOptions * | options_ |
Options which are used for customizing figures. More... | |
Private Member Functions | |
Figure & | operator= (Figure &old) |
Assignment not allowed. More... | |
Figure (Figure &old) | |
Copying not allowed. More... | |
Abstract base class for classes that represent the visuals of a machine block.
Can draw itself on the given device context. May contain other Figures as children, and in that case, knows also how to layout them.
Figure::Figure | ( | ) |
|
private |
Copying not allowed.
|
virtual |
Reimplemented in ContentsFigure.
Referenced by ContentsFigure::addChild(), and EditPart::addChild().
|
virtual |
Reimplemented in SelectionFigure.
Referenced by SelectionFigure::bounds(), SocketBusConnFigure::drawConnection(), SocketPortConnFigure::drawConnection(), MoveFigure::drawSelf(), SelectionFigure::drawSelf(), MachineCanvas::getFigureSize(), ContentsFigure::layoutChildren(), UnitContainerFigure::layoutSelf(), BusContainerFigure::layoutSelf(), SocketContainerFigure::layoutSelf(), SocketPortConnFigure::layoutSelf(), SocketBusConnFigure::layoutSelf(), ContentsFigure::layoutSelf(), MachineCanvas::OnDraw(), MachineCanvas::refreshToolFigure(), and setBounds().
Figure* Figure::child | ( | int | index | ) | const |
Referenced by UnitFigure::layoutChildren().
int Figure::childCount | ( | ) | const |
Referenced by UnitFigure::layoutChildren(), and BusFigure::virtualBounds().
void Figure::clearHighlight | ( | ) |
Clears highlighting of the figure.
The highlight is cleared next time the figure is drawn. This function has no effect if the figure isn't highlighted.
Definition at line 165 of file Figure.cc.
References children_, and highlighted_.
Referenced by MachineCanvas::clearHighlights().
void Figure::clearXSetFlag | ( | ) |
|
virtual |
Draws the Figure and its children on the given device context.
dc | The device context to draw the Figure on. |
Reimplemented in ContentsFigure.
Definition at line 138 of file Figure.cc.
References assert, drawChildren(), drawn_, drawSelf(), and laidOut_.
Referenced by ContentsFigure::draw(), and MachineCanvas::OnDraw().
|
protected |
|
protectedvirtual |
Reimplemented in BridgeFigure, SegmentFigure, UnitPortFigure, SelectionFigure, BidirBridgeFigure, InputSocketFigure, OutputSocketFigure, SocketBusConnFigure, SocketPortConnFigure, UnknownSocketFigure, TriggeringPortFigure, SocketBusConnToolFigure, SocketPortConnToolFigure, MoveFigure, BusFigure, UnitFigure, and BusChainFigure.
Referenced by draw().
void Figure::highlight | ( | const wxColour & | colour | ) |
Highlights the figure with given colour.
The figure is highlighted next time it's drawn.
colour | Highlight colour. |
Definition at line 182 of file Figure.cc.
References children_, highlight_, and highlighted_.
Referenced by MachineCanvas::highlight().
|
virtual |
Lays out the Figure and its children.
dc | The device context to layout children on. |
Reimplemented in UnitFigure.
Definition at line 109 of file Figure.cc.
References laidOut_, layoutChildren(), and layoutSelf().
Referenced by ContentsFigure::layoutChildren(), MachineCanvas::OnDraw(), and MachineCanvas::refreshToolFigure().
|
protectedvirtual |
Empty default implementation that can be used if no specific laying out needs to be done or the Figure doesn't have children.
Tells all children to layout themselves.
dc | Device context. |
Reimplemented in ContentsFigure, BusFigure, UnitFigure, BusContainerFigure, BidirBridgeFigure, BusChainFigure, UnitContainerFigure, UnitPortFigure, and SocketContainerFigure.
Definition at line 124 of file Figure.cc.
References children_.
Referenced by layout().
|
protectedvirtual |
Reimplemented in SocketBusConnFigure, SocketPortConnFigure, ContentsFigure, BusFigure, UnitFigure, BusContainerFigure, SocketContainerFigure, and UnitContainerFigure.
Referenced by layout().
wxPoint Figure::location | ( | ) | const |
MachineCanvasOptions * Figure::options | ( | ) |
Returns the options object used by this figure and it's children.
Definition at line 199 of file Figure.cc.
References options_.
Referenced by UnitFigure::drawSelf(), UnitFigure::layoutSelf(), and setOptions().
void Figure::setBounds | ( | wxSize | bounds | ) |
void Figure::setHeight | ( | int | height | ) |
Sets the height of the Figure.
height | New height. |
Definition at line 95 of file Figure.cc.
References minSize_, and size_.
Referenced by ContentsFigure::layoutChildren(), SocketPortConnFigure::layoutSelf(), and SocketBusConnFigure::layoutSelf().
void Figure::setLocation | ( | wxPoint | point | ) |
void Figure::setOptions | ( | MachineCanvasOptions * | options | ) |
Sets the options object used for setting drawing options.
Options are set recursively for figure children.
options | Options to set. |
Definition at line 212 of file Figure.cc.
References children_, options(), and options_.
Referenced by MachineCanvas::updateMachine().
void Figure::setPreferredX | ( | int | x | ) |
void Figure::setWidth | ( | int | width | ) |
Sets the width of the Figure.
width | New width. |
Definition at line 81 of file Figure.cc.
References minSize_, and size_.
Referenced by ContentsFigure::layoutChildren(), SocketPortConnFigure::layoutSelf(), and SocketBusConnFigure::layoutSelf().
void Figure::setX | ( | int | x | ) |
void Figure::setY | ( | int | y | ) |
|
virtual |
Reimplemented in BusFigure.
Referenced by EditPart::find(), EditPart::findInRange(), and EditPart::findNearest().
bool Figure::xSet | ( | ) | const |
Referenced by UnitContainerFigure::layoutChildren(), and UnitPortFigure::layoutChildren().
|
protected |
Figure's children.
Definition at line 90 of file Figure.hh.
Referenced by clearHighlight(), drawChildren(), BusFigure::drawSelf(), highlight(), SocketContainerFigure::layoutChildren(), BusChainFigure::layoutChildren(), UnitPortFigure::layoutChildren(), BidirBridgeFigure::layoutChildren(), UnitContainerFigure::layoutChildren(), BusContainerFigure::layoutChildren(), UnitFigure::layoutChildren(), BusFigure::layoutChildren(), layoutChildren(), UnitContainerFigure::layoutSelf(), SocketContainerFigure::layoutSelf(), BusContainerFigure::layoutSelf(), BusFigure::layoutSelf(), UnitFigure::layoutSelf(), and setOptions().
|
protected |
|
protected |
Highlight colour.
Definition at line 99 of file Figure.hh.
Referenced by TriggeringPortFigure::drawSelf(), InputSocketFigure::drawSelf(), OutputSocketFigure::drawSelf(), SegmentFigure::drawSelf(), UnitPortFigure::drawSelf(), UnitFigure::drawSelf(), and highlight().
|
protected |
Tells if the figure is highlighted.
Definition at line 101 of file Figure.hh.
Referenced by clearHighlight(), TriggeringPortFigure::drawSelf(), OutputSocketFigure::drawSelf(), InputSocketFigure::drawSelf(), SegmentFigure::drawSelf(), UnitPortFigure::drawSelf(), UnitFigure::drawSelf(), and highlight().
|
protected |
Tells whether the Figure and its children have been laid out or not.
Definition at line 95 of file Figure.hh.
Referenced by draw(), UnitFigure::layout(), layout(), and MoveFigure::MoveFigure().
|
protected |
Top-left location of the Figure's bounding rectangle.
Definition at line 84 of file Figure.hh.
Referenced by TriggeringPortFigure::drawSelf(), OutputSocketFigure::drawSelf(), UnknownSocketFigure::drawSelf(), InputSocketFigure::drawSelf(), UnitPortFigure::drawSelf(), BusChainFigure::drawSelf(), SegmentFigure::drawSelf(), BusFigure::drawSelf(), UnitFigure::drawSelf(), BridgeFigure::drawSelf(), SocketContainerFigure::layoutChildren(), UnitContainerFigure::layoutChildren(), BidirBridgeFigure::layoutChildren(), UnitPortFigure::layoutChildren(), BusChainFigure::layoutChildren(), BusContainerFigure::layoutChildren(), UnitFigure::layoutChildren(), BusFigure::layoutChildren(), ContentsFigure::layoutChildren(), UnitContainerFigure::layoutSelf(), SocketContainerFigure::layoutSelf(), and BusFigure::virtualBounds().
|
protected |
Figure's minimum size.
Definition at line 88 of file Figure.hh.
Referenced by BidirBridgeFigure::BidirBridgeFigure(), BusChainFigure::BusChainFigure(), BusFigure::BusFigure(), UnitFigure::layoutSelf(), SegmentFigure::SegmentFigure(), setBounds(), setHeight(), setWidth(), and UnitFigure::UnitFigure().
|
protected |
Options which are used for customizing figures.
Definition at line 104 of file Figure.hh.
Referenced by options(), and setOptions().
|
protected |
wxSize of the Figure's bounding rectangle.
Definition at line 86 of file Figure.hh.
Referenced by BidirBridgeFigure::BidirBridgeFigure(), BridgeFigure::BridgeFigure(), BusChainFigure::BusChainFigure(), BusFigure::BusFigure(), SocketBusConnFigure::drawConnection(), TriggeringPortFigure::drawSelf(), UnknownSocketFigure::drawSelf(), InputSocketFigure::drawSelf(), OutputSocketFigure::drawSelf(), UnitPortFigure::drawSelf(), SegmentFigure::drawSelf(), BusChainFigure::drawSelf(), BridgeFigure::drawSelf(), BusFigure::drawSelf(), UnitFigure::drawSelf(), InputSocketFigure::InputSocketFigure(), SocketContainerFigure::layoutChildren(), UnitPortFigure::layoutChildren(), BidirBridgeFigure::layoutChildren(), BusChainFigure::layoutChildren(), BusContainerFigure::layoutChildren(), UnitFigure::layoutChildren(), BusFigure::layoutChildren(), UnitContainerFigure::layoutSelf(), BusContainerFigure::layoutSelf(), SocketContainerFigure::layoutSelf(), UnitFigure::layoutSelf(), BusFigure::layoutSelf(), ContentsFigure::layoutSelf(), OutputSocketFigure::OutputSocketFigure(), SegmentFigure::SegmentFigure(), setBounds(), setHeight(), setWidth(), UnitFigure::UnitFigure(), UnitPortFigure::UnitPortFigure(), UnknownSocketFigure::UnknownSocketFigure(), and BusFigure::virtualBounds().
|
protected |