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

#include <BoxedLabelFigure.h>

Inheritance diagram for inet::BoxedLabelFigure:

Public Member Functions

 BoxedLabelFigure (const char *name=nullptr)
 
cLabelFigure * getLabelFigure () const
 
cRectangleFigure * getRectangleFigure () const
 
double getInset () const
 
void setInset (double inset)
 
void setTags (const char *tags)
 
void setTooltip (const char *tooltip)
 
void setAssociatedObject (cObject *object)
 
const cFigure::Rectangle & getBounds () const
 
const cFigure::Font & getFont () const
 
void setFont (cFigure::Font font)
 
const cFigure::Color & getLabelColor () const
 
void setLabelColor (cFigure::Color color)
 
const cFigure::Color & getBackgroundColor () const
 
void setBackgroundColor (cFigure::Color color)
 
const char * getText () const
 
void setText (const char *text)
 
double getOpacity () const
 
void setOpacity (double opacity)
 

Protected Attributes

double inset = 3
 
cLabelFigure * labelFigure
 
cRectangleFigure * rectangleFigure
 

Constructor & Destructor Documentation

◆ BoxedLabelFigure()

inet::BoxedLabelFigure::BoxedLabelFigure ( const char *  name = nullptr)
12  :
13  cGroupFigure(name)
14 {
15  labelFigure = new cLabelFigure("label");
16  rectangleFigure = new cRectangleFigure("box");
17  rectangleFigure->setFilled(true);
18  rectangleFigure->setLineColor(cFigure::BLACK);
19  addFigure(rectangleFigure);
20  addFigure(labelFigure);
21  setInset(inset);
22  setText(" "); // TODO empty string causes negative width/height in Tkenv
23 }

Member Function Documentation

◆ getBackgroundColor()

const cFigure::Color & inet::BoxedLabelFigure::getBackgroundColor ( ) const
77 {
78  return rectangleFigure->getFillColor();
79 }

◆ getBounds()

const cFigure::Rectangle & inet::BoxedLabelFigure::getBounds ( ) const
52 {
53  return rectangleFigure->getBounds();
54 }

◆ getFont()

const cFigure::Font & inet::BoxedLabelFigure::getFont ( ) const
57 {
58  return labelFigure->getFont();
59 }

◆ getInset()

double inet::BoxedLabelFigure::getInset ( ) const
inline
28 { return inset; }

◆ getLabelColor()

const cFigure::Color & inet::BoxedLabelFigure::getLabelColor ( ) const
67 {
68  return labelFigure->getColor();
69 }

◆ getLabelFigure()

cLabelFigure* inet::BoxedLabelFigure::getLabelFigure ( ) const
inline
25 { return labelFigure; }

◆ getOpacity()

double inet::BoxedLabelFigure::getOpacity ( ) const
100 {
101  return rectangleFigure->getFillOpacity();
102 }

◆ getRectangleFigure()

cRectangleFigure* inet::BoxedLabelFigure::getRectangleFigure ( ) const
inline

◆ getText()

const char * inet::BoxedLabelFigure::getText ( ) const
87 {
88  return labelFigure->getText();
89 }

◆ setAssociatedObject()

void inet::BoxedLabelFigure::setAssociatedObject ( cObject *  object)
46 {
47  labelFigure->setAssociatedObject(object);
48  rectangleFigure->setAssociatedObject(object);
49 }

Referenced by inet::visualizer::InterfaceTableCanvasVisualizer::createInterfaceVisualization().

◆ setBackgroundColor()

void inet::BoxedLabelFigure::setBackgroundColor ( cFigure::Color  color)

◆ setFont()

void inet::BoxedLabelFigure::setFont ( cFigure::Font  font)

◆ setInset()

void inet::BoxedLabelFigure::setInset ( double  inset)
26 {
27  this->inset = inset;
28  labelFigure->setPosition(cFigure::Point(inset, inset));
29  rectangleFigure->setCornerRx(inset);
30  rectangleFigure->setCornerRy(inset);
31 }

Referenced by BoxedLabelFigure(), and inet::visualizer::InterfaceTableCanvasVisualizer::createInterfaceVisualization().

◆ setLabelColor()

void inet::BoxedLabelFigure::setLabelColor ( cFigure::Color  color)

◆ setOpacity()

void inet::BoxedLabelFigure::setOpacity ( double  opacity)
105 {
106  rectangleFigure->setFillOpacity(opacity);
107  rectangleFigure->setLineOpacity(opacity);
108  labelFigure->setOpacity(opacity);
109 }

Referenced by inet::visualizer::InterfaceTableCanvasVisualizer::createInterfaceVisualization().

◆ setTags()

void inet::BoxedLabelFigure::setTags ( const char *  tags)

◆ setText()

void inet::BoxedLabelFigure::setText ( const char *  text)
92 {
93  double width, height, ascent;
94  getSimulation()->getEnvir()->getTextExtent(labelFigure->getFont(), text, width, height, ascent);
95  rectangleFigure->setBounds(cFigure::Rectangle(0, 0, width + inset * 2, height + inset * 2));
96  labelFigure->setText(text);
97 }

Referenced by BoxedLabelFigure(), inet::visualizer::InterfaceTableCanvasVisualizer::createInterfaceVisualization(), and inet::visualizer::InfoCanvasVisualizer::refreshInfoVisualization().

◆ setTooltip()

void inet::BoxedLabelFigure::setTooltip ( const char *  tooltip)
40 {
41  labelFigure->setTooltip(tooltip);
42  rectangleFigure->setTooltip(tooltip);
43 }

Referenced by inet::visualizer::InterfaceTableCanvasVisualizer::createInterfaceVisualization().

Member Data Documentation

◆ inset

double inet::BoxedLabelFigure::inset = 3
protected

Referenced by BoxedLabelFigure(), setInset(), and setText().

◆ labelFigure

cLabelFigure* inet::BoxedLabelFigure::labelFigure
protected

◆ rectangleFigure

cRectangleFigure* inet::BoxedLabelFigure::rectangleFigure
protected

The documentation for this class was generated from the following files:
inet::BoxedLabelFigure::setInset
void setInset(double inset)
Definition: BoxedLabelFigure.cc:25
inet::BoxedLabelFigure::inset
double inset
Definition: BoxedLabelFigure.h:18
inet::BoxedLabelFigure::rectangleFigure
cRectangleFigure * rectangleFigure
Definition: BoxedLabelFigure.h:20
tags
* tags
Definition: IUdp-gates.txt:3
inet::BoxedLabelFigure::labelFigure
cLabelFigure * labelFigure
Definition: BoxedLabelFigure.h:19
inet::BoxedLabelFigure::setText
void setText(const char *text)
Definition: BoxedLabelFigure.cc:91