Envision
A visual programming IDE for object-oriented languages
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes
OOInteraction::GridBasedOffsetProvider Class Reference
Inheritance diagram for OOInteraction::GridBasedOffsetProvider:
OOInteraction::StringOffsetProvider

Public Member Functions

 GridBasedOffsetProvider (Visualization::Item *vis)
 
 ~GridBasedOffsetProvider ()
 
void add (Cell *cell)
 Adds the cell cell to the grid of this string provider. More...
 
virtual int offset (Qt::Key key) override
 
void setFilterNullAndEmptyComponents ()
 
virtual void setOffset (int newOffset) override
 
void setSize (int width, int height)
 Sets the size of this grid string provider. More...
 
- Public Member Functions inherited from OOInteraction::StringOffsetProvider
 StringOffsetProvider (Visualization::Item *item)
 
virtual ~StringOffsetProvider ()
 
virtual bool isIndivisible ()
 Returns true when the visualization corresponding to this StringProvider is an indivisible entity. More...
 
Visualization::Itemitem () const
 
virtual QString string ()
 

Static Public Member Functions

template<typename T >
static void addGridConstructor (void(*constructor)(GridBasedOffsetProvider *provider, T *item))
 
static bool hasGridConstructorfor (Visualization::Item *item)
 
- Static Public Member Functions inherited from OOInteraction::StringOffsetProvider
static void allowGridBasedProvider (AllowGridBasedProviderFunction allow)
 
static QStringList components (Model::Node *node)
 
static StringOffsetProviderdefaultProvider (Visualization::Item *item)
 
static int itemOffset (Visualization::Item *item, int stringComponentLenght, Qt::Key key)
 
static int listItemOffset (Visualization::VList *list, const QString &prefix, const QString &separator, const QString &postfix, Qt::Key key)
 
static bool setOffsetInItem (int offset, Visualization::Item *item)
 
static bool setOffsetInListItem (int &offset, Visualization::VList *list, const QString &prefix, const QString &separator, const QString &postfix)
 
static QString stringFromComponenets (Model::Node *node)
 
static QString stringFromComponenets (Visualization::Item *item)
 
static QString stringFromStringOffsetProvider (Visualization::Item *item)
 

Protected Member Functions

virtual QStringList components () override
 

Private Types

enum  Direction { Left , Up , Right , Down }
 
using ItemTypeRegistrationFunction = void(*)(GridBasedOffsetProvider *provider, Visualization::Item *item)
 

Private Member Functions

CellfindCell (const QRect &start, Direction dir) const
 
bool isOnBottom (Cell *cell) const
 
bool isOnLeft (Cell *cell) const
 
bool isOnRight (Cell *cell) const
 
bool isOnTop (Cell *cell) const
 

Static Private Member Functions

static QMap< int, ItemTypeRegistrationFunction > & gridConstructors ()
 

Private Attributes

QList< Cell * > cells_
 
bool filterNullAndEmptyComponents_ {}
 
QSize size_
 

Additional Inherited Members

- Public Types inherited from OOInteraction::StringOffsetProvider
using AllowGridBasedProviderFunction = std::function< bool(Visualization::Item *)>
 
using BaseAdapteeType = Visualization::Item
 

Member Typedef Documentation

◆ ItemTypeRegistrationFunction

Member Enumeration Documentation

◆ Direction

Enumerator
Left 
Up 
Right 
Down 

Constructor & Destructor Documentation

◆ GridBasedOffsetProvider()

OOInteraction::GridBasedOffsetProvider::GridBasedOffsetProvider ( Visualization::Item vis)

◆ ~GridBasedOffsetProvider()

OOInteraction::GridBasedOffsetProvider::~GridBasedOffsetProvider ( )

Member Function Documentation

◆ add()

void OOInteraction::GridBasedOffsetProvider::add ( Cell cell)

Adds the cell cell to the grid of this string provider.

Every time a new cell is added the size of this provider will be adjusted if necessary to accommodate the new cell.

◆ addGridConstructor()

template<typename T >
void OOInteraction::GridBasedOffsetProvider::addGridConstructor ( void(*)(GridBasedOffsetProvider *provider, T *item constructor)
inlinestatic

◆ components()

QStringList OOInteraction::GridBasedOffsetProvider::components ( )
overrideprotectedvirtual

◆ findCell()

Cell * OOInteraction::GridBasedOffsetProvider::findCell ( const QRect &  start,
Direction  dir 
) const
private

◆ gridConstructors()

QMap< int, void(*)(GridBasedOffsetProvider *provider, Visualization::Item *item)> & OOInteraction::GridBasedOffsetProvider::gridConstructors ( )
staticprivate

◆ hasGridConstructorfor()

bool OOInteraction::GridBasedOffsetProvider::hasGridConstructorfor ( Visualization::Item item)
static

◆ isOnBottom()

bool OOInteraction::GridBasedOffsetProvider::isOnBottom ( Cell cell) const
inlineprivate

◆ isOnLeft()

bool OOInteraction::GridBasedOffsetProvider::isOnLeft ( Cell cell) const
inlineprivate

◆ isOnRight()

bool OOInteraction::GridBasedOffsetProvider::isOnRight ( Cell cell) const
inlineprivate

◆ isOnTop()

bool OOInteraction::GridBasedOffsetProvider::isOnTop ( Cell cell) const
inlineprivate

◆ offset()

int OOInteraction::GridBasedOffsetProvider::offset ( Qt::Key  key)
overridevirtual

◆ setFilterNullAndEmptyComponents()

void OOInteraction::GridBasedOffsetProvider::setFilterNullAndEmptyComponents ( )
inline

◆ setOffset()

void OOInteraction::GridBasedOffsetProvider::setOffset ( int  newOffset)
overridevirtual

◆ setSize()

void OOInteraction::GridBasedOffsetProvider::setSize ( int  width,
int  height 
)
inline

Sets the size of this grid string provider.

It is only necessary to call this method if padding is required. Otherwise simply using add() is sufficient.

Member Data Documentation

◆ cells_

QList<Cell*> OOInteraction::GridBasedOffsetProvider::cells_
private

◆ filterNullAndEmptyComponents_

bool OOInteraction::GridBasedOffsetProvider::filterNullAndEmptyComponents_ {}
private

◆ size_

QSize OOInteraction::GridBasedOffsetProvider::size_
private