OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ot::GraphicsFlowItemBuilder Class Reference

#include "GraphicsFlowItemBuilder.h"

Public Types

enum  BackgroundImageInsertMode { OnLayout , OnStack }
 

Public Member Functions

ot::GraphicsItemCfgcreateGraphicsItem (void) const
 Creates a GraphicsItemCfg in the "OpenTwin flow block" style that takes the current configuration into account. The callee takes ownership of the item.
 
 GraphicsFlowItemBuilder ()
 
virtual ~GraphicsFlowItemBuilder ()
 
void setName (const std::string &_name)
 Sets the name for the root item The item name will be used as a prefix for the created child items (layouts and stacks)
 
const std::string & name (void) const
 Item name.
 
void setTitle (const std::string &_title)
 Sets the title that will be displayed to the user.
 
const std::string & title (void) const
 Item title.
 
void setToolTip (const std::string &_toolTip)
 Set the item tool tip.
 
const std::string & toolTip (void) const
 Set the item tool tip.
 
void addLeft (const std::string &_name, const std::string &_title, GraphicsFlowItemConnector::ConnectorFigure _figure)
 Add a connector on the left side of the FlowItem The default connector style will be applied.
 
void addLeft (const std::string &_name, const std::string &_title, GraphicsFlowItemConnector::ConnectorFigure _figure, ot::DefaultColor _color)
 Add a connector on the left side of the FlowItem The default connector style will be applied.
 
void addLeft (const std::string &_name, const std::string &_title, GraphicsFlowItemConnector::ConnectorFigure _figure, const ot::Color &_color)
 Add a connector on the left side of the FlowItem The default connector style will be applied.
 
void addLeft (const GraphicsFlowItemConnector &_left)
 Add the provided connector as input.
 
void addRight (const std::string &_name, const std::string &_title, GraphicsFlowItemConnector::ConnectorFigure _figure)
 Add a connector on the right side of the FlowItem The default connector style will be applied.
 
void addRight (const std::string &_name, const std::string &_title, GraphicsFlowItemConnector::ConnectorFigure _figure, ot::DefaultColor _color)
 Add a connector on the right side of the FlowItem The default connector style will be applied.
 
void addRight (const std::string &_name, const std::string &_title, GraphicsFlowItemConnector::ConnectorFigure _figure, const ot::Color &_color)
 Add a connector on the right side of the FlowItem The default connector style will be applied.
 
void addRight (const GraphicsFlowItemConnector &_right)
 Add the provided connector as output.
 
void setTitleBackgroundPainter (ot::Painter2D *_painter)
 Replace the current title background painter The item takes ownership.
 
void setTitleBackgroundColor (const ot::Color &_color)
 Sets the title background color Creates a FillPainter2D and replace the current title background painter.
 
void setTitleBackgroundGradientColor (const ot::Color &_color)
 Sets the title background painter Creates a LinearGradientPainter2D and replace the current title background painter.
 
void setTitleBackgroundColor (int _r, int _g, int _b, int _a=255)
 Sets the title background color Will create a FillPainter2D and replace the current title background painter.
 
void setTitleForegroundPainter (ot::Painter2D *_painter)
 Replace the current title foreground painter The item takes ownership.
 
void setTitleForegroundColor (const ot::Color &_color)
 Sets the title foreground painter Create a FillPainter2D and replace the current title foreground painter.
 
void setDefaultTitleForegroundGradient (void)
 Sets the title foreground painter Create a LinearGradientPainter2D and replace the current title foreground painter.
 
void setDefaultConnectorStyle (const GraphicsFlowItemConnector &_config)
 Sets the default connector style The new default style will only affect items added after settings the style. The defualt style is applied to connetors added via addInput() or addOutput() (with exceptions, see function comments)
 
const GraphicsFlowItemConnectordefaultConnectorStyle (void) const
 
void setBackgroundImagePath (const std::string &_path)
 
void setBackgroundImageAlignment (ot::Alignment _align)
 
void setBackgroundImageMargins (const ot::MarginsD &_margins)
 
void setBackgroundImageInsertMode (BackgroundImageInsertMode _mode)
 
void setBackgroundImageMaintainAspectRatio (bool _active)
 
void setLeftTitleCornerImagePath (const std::string &_path)
 
void setRightTitleCornerImagePath (const std::string &_path)
 

Member Enumeration Documentation

◆ BackgroundImageInsertMode

Enumerator
OnLayout 
OnStack 

Constructor & Destructor Documentation

◆ GraphicsFlowItemBuilder()

ot::GraphicsFlowItemBuilder::GraphicsFlowItemBuilder ( )

◆ ~GraphicsFlowItemBuilder()

ot::GraphicsFlowItemBuilder::~GraphicsFlowItemBuilder ( )
virtual

Member Function Documentation

◆ addLeft() [1/4]

void ot::GraphicsFlowItemBuilder::addLeft ( const GraphicsFlowItemConnector & _left)

Add the provided connector as input.

Parameters
_inputConnector configuration

◆ addLeft() [2/4]

void ot::GraphicsFlowItemBuilder::addLeft ( const std::string & _name,
const std::string & _title,
GraphicsFlowItemConnector::ConnectorFigure _figure )

Add a connector on the left side of the FlowItem The default connector style will be applied.

Parameters
_nameConnector name
_titleConnector title
_figureConector figure

◆ addLeft() [3/4]

void ot::GraphicsFlowItemBuilder::addLeft ( const std::string & _name,
const std::string & _title,
GraphicsFlowItemConnector::ConnectorFigure _figure,
const ot::Color & _color )

Add a connector on the left side of the FlowItem The default connector style will be applied.

Parameters
_nameConnector name
_titleConnector title
_figureConector figure

◆ addLeft() [4/4]

void ot::GraphicsFlowItemBuilder::addLeft ( const std::string & _name,
const std::string & _title,
GraphicsFlowItemConnector::ConnectorFigure _figure,
ot::DefaultColor _color )

Add a connector on the left side of the FlowItem The default connector style will be applied.

Parameters
_nameConnector name
_titleConnector title
_figureConector figure

◆ addRight() [1/4]

void ot::GraphicsFlowItemBuilder::addRight ( const GraphicsFlowItemConnector & _right)

Add the provided connector as output.

Parameters
_inputConnector configuration

◆ addRight() [2/4]

void ot::GraphicsFlowItemBuilder::addRight ( const std::string & _name,
const std::string & _title,
GraphicsFlowItemConnector::ConnectorFigure _figure )

Add a connector on the right side of the FlowItem The default connector style will be applied.

Parameters
_nameConnector name
_titleConnector title
_figureConnector figure

◆ addRight() [3/4]

void ot::GraphicsFlowItemBuilder::addRight ( const std::string & _name,
const std::string & _title,
GraphicsFlowItemConnector::ConnectorFigure _figure,
const ot::Color & _color )

Add a connector on the right side of the FlowItem The default connector style will be applied.

Parameters
_nameConnector name
_titleConnector title
_figureConnector figure

◆ addRight() [4/4]

void ot::GraphicsFlowItemBuilder::addRight ( const std::string & _name,
const std::string & _title,
GraphicsFlowItemConnector::ConnectorFigure _figure,
ot::DefaultColor _color )

Add a connector on the right side of the FlowItem The default connector style will be applied.

Parameters
_nameConnector name
_titleConnector title
_figureConnector figure

◆ createGraphicsItem()

ot::GraphicsItemCfg * ot::GraphicsFlowItemBuilder::createGraphicsItem ( void ) const

Creates a GraphicsItemCfg in the "OpenTwin flow block" style that takes the current configuration into account. The callee takes ownership of the item.

◆ defaultConnectorStyle()

const GraphicsFlowItemConnector & ot::GraphicsFlowItemBuilder::defaultConnectorStyle ( void ) const
inline

◆ name()

const std::string & ot::GraphicsFlowItemBuilder::name ( void ) const
inline

Item name.

◆ setBackgroundImageAlignment()

void ot::GraphicsFlowItemBuilder::setBackgroundImageAlignment ( ot::Alignment _align)
inline

◆ setBackgroundImageInsertMode()

void ot::GraphicsFlowItemBuilder::setBackgroundImageInsertMode ( BackgroundImageInsertMode _mode)
inline

◆ setBackgroundImageMaintainAspectRatio()

void ot::GraphicsFlowItemBuilder::setBackgroundImageMaintainAspectRatio ( bool _active)
inline

◆ setBackgroundImageMargins()

void ot::GraphicsFlowItemBuilder::setBackgroundImageMargins ( const ot::MarginsD & _margins)
inline

◆ setBackgroundImagePath()

void ot::GraphicsFlowItemBuilder::setBackgroundImagePath ( const std::string & _path)
inline

◆ setDefaultConnectorStyle()

void ot::GraphicsFlowItemBuilder::setDefaultConnectorStyle ( const GraphicsFlowItemConnector & _config)
inline

Sets the default connector style The new default style will only affect items added after settings the style. The defualt style is applied to connetors added via addInput() or addOutput() (with exceptions, see function comments)

◆ setDefaultTitleForegroundGradient()

void ot::GraphicsFlowItemBuilder::setDefaultTitleForegroundGradient ( void )

Sets the title foreground painter Create a LinearGradientPainter2D and replace the current title foreground painter.

Parameters
_colorThe primary text color, other colors are calculated by 255-color

◆ setLeftTitleCornerImagePath()

void ot::GraphicsFlowItemBuilder::setLeftTitleCornerImagePath ( const std::string & _path)
inline

◆ setName()

void ot::GraphicsFlowItemBuilder::setName ( const std::string & _name)
inline

Sets the name for the root item The item name will be used as a prefix for the created child items (layouts and stacks)

◆ setRightTitleCornerImagePath()

void ot::GraphicsFlowItemBuilder::setRightTitleCornerImagePath ( const std::string & _path)
inline

◆ setTitle()

void ot::GraphicsFlowItemBuilder::setTitle ( const std::string & _title)
inline

Sets the title that will be displayed to the user.

◆ setTitleBackgroundColor() [1/2]

void ot::GraphicsFlowItemBuilder::setTitleBackgroundColor ( const ot::Color & _color)

Sets the title background color Creates a FillPainter2D and replace the current title background painter.

◆ setTitleBackgroundColor() [2/2]

void ot::GraphicsFlowItemBuilder::setTitleBackgroundColor ( int _r,
int _g,
int _b,
int _a = 255 )
inline

Sets the title background color Will create a FillPainter2D and replace the current title background painter.

◆ setTitleBackgroundGradientColor()

void ot::GraphicsFlowItemBuilder::setTitleBackgroundGradientColor ( const ot::Color & _color)

Sets the title background painter Creates a LinearGradientPainter2D and replace the current title background painter.

◆ setTitleBackgroundPainter()

void ot::GraphicsFlowItemBuilder::setTitleBackgroundPainter ( ot::Painter2D * _painter)

Replace the current title background painter The item takes ownership.

◆ setTitleForegroundColor()

void ot::GraphicsFlowItemBuilder::setTitleForegroundColor ( const ot::Color & _color)

Sets the title foreground painter Create a FillPainter2D and replace the current title foreground painter.

◆ setTitleForegroundPainter()

void ot::GraphicsFlowItemBuilder::setTitleForegroundPainter ( ot::Painter2D * _painter)

Replace the current title foreground painter The item takes ownership.

◆ setToolTip()

void ot::GraphicsFlowItemBuilder::setToolTip ( const std::string & _toolTip)
inline

Set the item tool tip.

◆ title()

const std::string & ot::GraphicsFlowItemBuilder::title ( void ) const
inline

Item title.

◆ toolTip()

const std::string & ot::GraphicsFlowItemBuilder::toolTip ( void ) const
inline

Set the item tool tip.


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