30 #include "../singleton/Context.h"
31 #include "../../AbstractScene.h"
32 #include "../../property/Properties.h"
35 #include "../../../../geometry/Coord2D.h"
38 m_controller(controller),
41 m_canChangeGraphicOrder(true),
42 m_nameClass(
"Unknown"),
43 m_invertedMatrix(false)
64 x = m_model->getBox().getLowerLeftX();
65 y = m_model->getBox().getLowerLeftY();
72 updateObserver(context);
75 m_controller->redraw();
83 m_controller->setPosition(coord.
x, coord.
y);
85 setZValueItem(getZValueItem());
111 m_model->setZValue(z);
116 m_canChangeGraphicOrder = canChange;
121 return m_canChangeGraphicOrder;
131 return m_invertedMatrix;
Abstract class to represent an observable. "Model" part of MVC component.
Class responsible for maintaining the drawing context of a MVC component. It is always used by the "M...
Abstract class to represent a controller. "Controller" part of MVC component. All classes representin...
te::layout::Observable * m_model
"Model" part of MVC component.
Abstract class to represent an observer. "View" part of MVC component. All classes representing the g...
Abstract class to represent an observable. "Model" part of MVC component.
virtual void setPrintable(bool print)
Modifies the state of the graphic component to be or not printable.
virtual ~ItemObserver()
Destructor.
virtual void setZValueItem(int z)
The Z value decides the stacking order of drawing.
An utility struct for representing 2D coordinates.
Abstract class to represent a controller. "Controller" part of MVC component. All classes representin...
virtual void recalculateBoundingRect()
The default implementation does nothing.
virtual bool isInvertedMatrix()
Returns whether the graph component has the inverted matrix, otherwise the matrix scene...
virtual void redraw(bool bRefresh=true)
Redraws the graphic component.
virtual bool isPrintable()
Returns whether the graphic component is printable.
ItemObserver(ItemController *controller=0, Observable *o=0)
Constructor.
void setPos(te::gm::Coord2D pos)
virtual void changeZoomFactor(double currentZoomFactor)
It is called immediately by the Scene when the zoom factor is changed in the Context.
virtual bool isCanChangeGraphicOrder()
Returns whether the graphic component to be or not send to back or bring to front.
virtual std::string getNameClass()
Method that returns the class name.
void setChangePos(bool change)
virtual void refresh(bool pos=true)
Updated model state.
virtual bool addObserver(Observer *o)=0
Adds the specified observer to the set of observers for this object. Reimplement this function in a O...
virtual void setCanChangeGraphicOrder(bool canChange)
Change the state of the graphic component to be or not send to back or bring to front.
virtual ItemController * getController()
Returns the "Controller" part of the MVC.
virtual Observable * getModel()
Returns the "Model" part of the MVC.