All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::layout::ItemController Class Reference

Abstract class to represent a controller. "Controller" part of MVC component. All classes representing the controller of a component must inherit from this class. More...

#include <ItemController.h>

Inheritance diagram for te::layout::ItemController:
te::layout::ArrowController te::layout::BalloonController te::layout::EllipseController te::layout::GridMapController te::layout::ImageController te::layout::ItemGroupController te::layout::LegendController te::layout::LineController te::layout::MapController te::layout::NorthController te::layout::PaperController te::layout::PointController te::layout::RectangleController te::layout::ScaleController te::layout::TextController

Public Member Functions

virtual bool contains (const te::gm::Coord2D &coord) const
 Checks if the coordinate is contained within the bounding rectangle. More...
 
const ObservablegetModel ()
 Returns the "Model" part of the MVC component. More...
 
const ObservergetView ()
 Returns the "View" part of the MVC component. More...
 
 ItemController (Observable *o)
 Constructor. More...
 
virtual void redraw ()
 Redraws the MVC component. Creates the ContextItem object and configures it. Calls the draw method of the model. More...
 
virtual void setBox (te::gm::Envelope box)
 Change the bounding rectangle. More...
 
virtual void setPosition (const double &x, const double &y)
 Change coordinate llx,lly of the MVC component. More...
 
virtual ~ItemController ()
 Destructor. More...
 

Protected Member Functions

virtual void create ()
 Call factory to create the "View" part of the MVC component and passes the model and himself as controller. More...
 

Protected Attributes

Observablem_model
 "Model" part of the MVC component. More...
 
Observerm_view
 "View" part of the MVC component. More...
 

Detailed Description

Abstract class to represent a controller. "Controller" part of MVC component. All classes representing the controller of a component must inherit from this class.

Definition at line 52 of file ItemController.h.

Constructor & Destructor Documentation

te::layout::ItemController::ItemController ( Observable o)

Constructor.

Parameters
o"Model" part of MVC component

Definition at line 39 of file ItemController.cpp.

References create().

te::layout::ItemController::~ItemController ( )
virtual

Destructor.

Definition at line 45 of file ItemController.cpp.

Member Function Documentation

bool te::layout::ItemController::contains ( const te::gm::Coord2D coord) const
virtual

Checks if the coordinate is contained within the bounding rectangle.

Parameters
coordcoordinated to be verified
Returns
true if contains, false otherwise

Definition at line 104 of file ItemController.cpp.

References te::layout::ItemModelObservable::contains(), and te::layout::ItemObserver::refresh().

void te::layout::ItemController::create ( )
protectedvirtual

Call factory to create the "View" part of the MVC component and passes the model and himself as controller.

Definition at line 121 of file ItemController.cpp.

References te::common::Singleton< Context >::getInstance(), te::layout::Context::getItemFactory(), and te::layout::AbstractItemFactory::make().

Referenced by ItemController().

const te::layout::Observable * te::layout::ItemController::getModel ( )

Returns the "Model" part of the MVC component.

Returns
model

Definition at line 84 of file ItemController.cpp.

void te::layout::ItemController::setBox ( te::gm::Envelope  box)
virtual

Change the bounding rectangle.

Parameters
boundingrectangle

Definition at line 94 of file ItemController.cpp.

References te::layout::ItemModelObservable::setBox().

void te::layout::ItemController::setPosition ( const double &  x,
const double &  y 
)
virtual

Change coordinate llx,lly of the MVC component.

Parameters
xllx
ylly

Definition at line 128 of file ItemController.cpp.

References te::layout::ItemModelObservable::setPosition().

Member Data Documentation

Observable* te::layout::ItemController::m_model
protected

"Model" part of the MVC component.

Definition at line 118 of file ItemController.h.

Observer* te::layout::ItemController::m_view
protected

"View" part of the MVC component.

Definition at line 119 of file ItemController.h.


The documentation for this class was generated from the following files: