Envision
A visual programming IDE for object-oriented languages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
Visualization::GridLayout Class Reference
Inheritance diagram for Visualization::GridLayout:
Core::Reflect< Base >

Public Types

typedef GridLayoutStyle StyleType
 

Public Member Functions

 GridLayout (Item *parent, const StyleType *style=itemStyles().get())
 
 ~GridLayout ()
 
virtual QList< Visualization::VisualizationAddOn * > addOns () override
 
template<typename T >
T * at (int x, int y)
 
template<typename T >
T * at (int x, int y) const
 
void clear (bool deleteItems=true)
 
QPoint focusedElementIndex () const
 
QSize gridSize () const
 
virtual Visualization::InteractionHandlerhandler () const override
 
virtual bool isEmpty () const override
 
bool isEmpty (int x, int y) const
 
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
 
void remove (int x, int y, bool deleteItem=true)
 
void remove (Item *item, bool deleteItem=true)
 
void set (Item *item, int x, int y, bool deleteOldItem)
 
void setGridSize (int sizeX, int sizeY, bool deleteExtraItems)
 
virtual void setStyle (const Visualization::ItemStyle *itemStyle) override
 
const StyleTypestyle () const
 
void swap (int x1, int y1, int x2, int y2)
 
void synchronizeWithNodes (const QList< QList< Model::Node * > > &nodes)
 Updates the content of the grid to match 'nodes'. More...
 
virtual void updateGeometry (int availableWidth, int availableHeight) override
 

Static Public Member Functions

static void addAddOn (Visualization::VisualizationAddOn *addOn)
 
static Visualization::InteractionHandlerdefaultClassHandler ()
 
static Visualization::StyleSet< GridLayout > & itemStyles ()
 
static bool removeAddOn (Visualization::VisualizationAddOn *addOn)
 
static void setDefaultClassHandler (Visualization::InteractionHandler *handler)
 

Private Member Functions

ItemfindFirstHorizontal (bool startFromLeft)
 
ItemfindFirstVertical (bool startFromTop)
 
ItemfindNext (int dx, int dy)
 

Static Private Member Functions

static QList< Visualization::VisualizationAddOn * > & staticAddOns ()
 

Private Attributes

QVector< QVector< Item * > > items_
 
int sizeX_
 
int sizeY_
 

Static Private Attributes

static Visualization::InteractionHandlerdefaultClassHandler_ = nullptr
 

Additional Inherited Members

- Protected Types inherited from Core::Reflect< Base >
using Super = Reflect< Base >
 

Member Typedef Documentation

◆ StyleType

Constructor & Destructor Documentation

◆ GridLayout()

Visualization::GridLayout::GridLayout ( Item parent,
const StyleType style = itemStyles().get() 
)

◆ ~GridLayout()

Visualization::GridLayout::~GridLayout ( )

Member Function Documentation

◆ addAddOn()

void Visualization::GridLayout::addAddOn ( Visualization::VisualizationAddOn addOn)
static

◆ addOns()

QList< Visualization::VisualizationAddOn * > Visualization::GridLayout::addOns ( )
overridevirtual

◆ at() [1/2]

template<typename T >
T * Visualization::GridLayout::at ( int  x,
int  y 
)
inline

◆ at() [2/2]

template<typename T >
T * Visualization::GridLayout::at ( int  x,
int  y 
) const
inline

◆ clear()

void Visualization::GridLayout::clear ( bool  deleteItems = true)

◆ defaultClassHandler()

static Visualization::InteractionHandler* Visualization::GridLayout::defaultClassHandler ( )
inlinestatic

◆ findFirstHorizontal()

Item * Visualization::GridLayout::findFirstHorizontal ( bool  startFromLeft)
private

◆ findFirstVertical()

Item * Visualization::GridLayout::findFirstVertical ( bool  startFromTop)
private

◆ findNext()

Item * Visualization::GridLayout::findNext ( int  dx,
int  dy 
)
private

◆ focusedElementIndex()

QPoint Visualization::GridLayout::focusedElementIndex ( ) const

◆ gridSize()

QSize Visualization::GridLayout::gridSize ( ) const
inline

◆ handler()

Visualization::InteractionHandler * Visualization::GridLayout::handler ( ) const
overridevirtual

◆ isEmpty() [1/2]

bool Visualization::GridLayout::isEmpty ( ) const
overridevirtual

◆ isEmpty() [2/2]

bool Visualization::GridLayout::isEmpty ( int  x,
int  y 
) const

◆ itemStyles()

Visualization::StyleSet< GridLayout > & Visualization::GridLayout::itemStyles ( )
static

◆ paint()

void Visualization::GridLayout::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget 
)
overridevirtual

◆ remove() [1/2]

void Visualization::GridLayout::remove ( int  x,
int  y,
bool  deleteItem = true 
)

◆ remove() [2/2]

void Visualization::GridLayout::remove ( Item item,
bool  deleteItem = true 
)

◆ removeAddOn()

bool Visualization::GridLayout::removeAddOn ( Visualization::VisualizationAddOn addOn)
static

◆ set()

void Visualization::GridLayout::set ( Item item,
int  x,
int  y,
bool  deleteOldItem 
)

◆ setDefaultClassHandler()

static void Visualization::GridLayout::setDefaultClassHandler ( Visualization::InteractionHandler handler)
inlinestatic

◆ setGridSize()

void Visualization::GridLayout::setGridSize ( int  sizeX,
int  sizeY,
bool  deleteExtraItems 
)

◆ setStyle()

void Visualization::GridLayout::setStyle ( const Visualization::ItemStyle itemStyle)
overridevirtual

◆ staticAddOns()

QList< Visualization::VisualizationAddOn * > & Visualization::GridLayout::staticAddOns ( )
staticprivate

◆ style()

const StyleType* Visualization::GridLayout::style ( ) const
inline

◆ swap()

void Visualization::GridLayout::swap ( int  x1,
int  y1,
int  x2,
int  y2 
)

◆ synchronizeWithNodes()

void Visualization::GridLayout::synchronizeWithNodes ( const QList< QList< Model::Node * > > &  nodes)

Updates the content of the grid to match 'nodes'.

The elements of the grid are updated so that they contain visualizations of the provided nodes. The grid will be resized if necessary.

Parameters
nodesA list of rows. The first row in the list is the topmost one. Each row is a list of nodes starting from the leftmost node.

◆ updateGeometry()

void Visualization::GridLayout::updateGeometry ( int  availableWidth,
int  availableHeight 
)
overridevirtual

Member Data Documentation

◆ defaultClassHandler_

Visualization::InteractionHandler * Visualization::GridLayout::defaultClassHandler_ = nullptr
staticprivate

◆ items_

QVector< QVector<Item*> > Visualization::GridLayout::items_
private

◆ sizeX_

int Visualization::GridLayout::sizeX_
private

◆ sizeY_

int Visualization::GridLayout::sizeY_
private