INET Framework for OMNeT++/OMNEST
inet::LabeledIconFigure Class Reference

#include <LabeledIconFigure.h>

Inheritance diagram for inet::LabeledIconFigure:

Public Member Functions

 LabeledIconFigure (const char *name=nullptr)
 
cIconFigure * getIconFigure () const
 
cLabelFigure * getLabelFigure () const
 
void setTooltip (const char *tooltip)
 
void setAssociatedObject (cObject *object)
 
cFigure::Rectangle getBounds () const
 
void setOpacity (double opacity)
 
void setPosition (cFigure::Point position)
 

Protected Attributes

cIconFigure * iconFigure
 
cLabelFigure * labelFigure
 

Constructor & Destructor Documentation

inet::LabeledIconFigure::LabeledIconFigure ( const char *  name = nullptr)
22  :
23  cGroupFigure(name)
24 {
25  iconFigure = new cIconFigure("icon");
26  iconFigure->setAnchor(cFigure::ANCHOR_NW);
27  labelFigure = new cLabelFigure("label");
28  labelFigure->setAnchor(cFigure::ANCHOR_CENTER);
29  labelFigure->setTags("label");
30  labelFigure->setHalo(true);
31  addFigure(iconFigure);
32  addFigure(labelFigure);
33 }
cLabelFigure * labelFigure
Definition: LabeledIconFigure.h:29
cIconFigure * iconFigure
Definition: LabeledIconFigure.h:28

Member Function Documentation

cFigure::Rectangle inet::LabeledIconFigure::getBounds ( ) const
48 {
49  auto iconBounds = iconFigure->getBounds();
50  auto labelBounds = labelFigure->getBounds();
51  auto x = std::min(iconBounds.x, labelBounds.x);
52  auto y = std::min(iconBounds.y, labelBounds.y);
53  auto width = std::max(iconBounds.x + iconBounds.width, labelBounds.x + labelBounds.width) - x;
54  auto height = std::max(iconBounds.y + iconBounds.height, labelBounds.y + labelBounds.height) - y;
55  return cFigure::Rectangle(x, y, width, height);
56 }
cLabelFigure * labelFigure
Definition: LabeledIconFigure.h:29
double min(const double a, const double b)
Returns the minimum of a and b.
Definition: SCTPAssociation.h:270
double max(double a, double b)
Returns the greater of the given parameters.
Definition: INETMath.h:161
cIconFigure * iconFigure
Definition: LabeledIconFigure.h:28
cIconFigure* inet::LabeledIconFigure::getIconFigure ( ) const
inline
34 { return iconFigure; }
cIconFigure * iconFigure
Definition: LabeledIconFigure.h:28
cLabelFigure* inet::LabeledIconFigure::getLabelFigure ( ) const
inline

Referenced by inet::visualizer::TransportConnectionCanvasVisualizer::setConnectionLabelsVisible().

35 { return labelFigure; }
cLabelFigure * labelFigure
Definition: LabeledIconFigure.h:29
void inet::LabeledIconFigure::setAssociatedObject ( cObject *  object)
42 {
43  iconFigure->setAssociatedObject(object);
44  labelFigure->setAssociatedObject(object);
45 }
cLabelFigure * labelFigure
Definition: LabeledIconFigure.h:29
cIconFigure * iconFigure
Definition: LabeledIconFigure.h:28
void inet::LabeledIconFigure::setOpacity ( double  opacity)

Referenced by inet::visualizer::PacketDropCanvasVisualizer::setAlpha().

59 {
60  iconFigure->setOpacity(opacity);
61  labelFigure->setOpacity(opacity);
62 }
cLabelFigure * labelFigure
Definition: LabeledIconFigure.h:29
cIconFigure * iconFigure
Definition: LabeledIconFigure.h:28
void inet::LabeledIconFigure::setPosition ( cFigure::Point  position)

Referenced by inet::visualizer::PacketDropCanvasVisualizer::setAlpha().

65 {
66  iconFigure->setPosition(position);
67  labelFigure->setPosition(position);
68 }
cLabelFigure * labelFigure
Definition: LabeledIconFigure.h:29
cIconFigure * iconFigure
Definition: LabeledIconFigure.h:28
void inet::LabeledIconFigure::setTooltip ( const char *  tooltip)
36 {
37  iconFigure->setTooltip(tooltip);
38  labelFigure->setTooltip(tooltip);
39 }
cLabelFigure * labelFigure
Definition: LabeledIconFigure.h:29
cIconFigure * iconFigure
Definition: LabeledIconFigure.h:28

Member Data Documentation

cIconFigure* inet::LabeledIconFigure::iconFigure
protected
cLabelFigure* inet::LabeledIconFigure::labelFigure
protected

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