#include "GraphicsFlowItemBuilder.h"
Public Types | |
enum | BackgroundImageInsertMode { OnLayout , OnStack } |
Public Member Functions | |
ot::GraphicsItemCfg * | 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. | |
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 GraphicsFlowItemConnector & | defaultConnectorStyle (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) |
ot::GraphicsFlowItemBuilder::GraphicsFlowItemBuilder | ( | ) |
|
virtual |
void ot::GraphicsFlowItemBuilder::addLeft | ( | const GraphicsFlowItemConnector & | _left | ) |
Add the provided connector as input.
_input | Connector configuration |
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.
_name | Connector name |
_title | Connector title |
_figure | Conector figure |
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.
_name | Connector name |
_title | Connector title |
_figure | Conector figure |
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.
_name | Connector name |
_title | Connector title |
_figure | Conector figure |
void ot::GraphicsFlowItemBuilder::addRight | ( | const GraphicsFlowItemConnector & | _right | ) |
Add the provided connector as output.
_input | Connector configuration |
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.
_name | Connector name |
_title | Connector title |
_figure | Connector figure |
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.
_name | Connector name |
_title | Connector title |
_figure | Connector figure |
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.
_name | Connector name |
_title | Connector title |
_figure | Connector figure |
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.
|
inline |
|
inline |
Item name.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
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)
void ot::GraphicsFlowItemBuilder::setDefaultTitleForegroundGradient | ( | void | ) |
Sets the title foreground painter Create a LinearGradientPainter2D and replace the current title foreground painter.
_color | The primary text color, other colors are calculated by 255-color |
|
inline |
|
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)
|
inline |
|
inline |
Sets the title that will be displayed to the user.
void ot::GraphicsFlowItemBuilder::setTitleBackgroundColor | ( | const ot::Color & | _color | ) |
Sets the title background color Creates a FillPainter2D and replace the current title background painter.
|
inline |
Sets the title background color Will create a FillPainter2D and replace the current title background painter.
void ot::GraphicsFlowItemBuilder::setTitleBackgroundGradientColor | ( | const ot::Color & | _color | ) |
Sets the title background painter Creates a LinearGradientPainter2D and replace the current title background painter.
void ot::GraphicsFlowItemBuilder::setTitleBackgroundPainter | ( | ot::Painter2D * | _painter | ) |
Replace the current title background painter The item takes ownership.
void ot::GraphicsFlowItemBuilder::setTitleForegroundColor | ( | const ot::Color & | _color | ) |
Sets the title foreground painter Create a FillPainter2D and replace the current title foreground painter.
void ot::GraphicsFlowItemBuilder::setTitleForegroundPainter | ( | ot::Painter2D * | _painter | ) |
Replace the current title foreground painter The item takes ownership.
|
inline |
Set the item tool tip.
|
inline |
Item title.
|
inline |
Set the item tool tip.