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

inet::BoxedLabelFigure::BoxedLabelFigure ( const char *  name = nullptr)
22  :
23  cGroupFigure(name)
24 {
25  labelFigure = new cLabelFigure("label");
26  rectangleFigure = new cRectangleFigure("box");
27  rectangleFigure->setFilled(true);
28  rectangleFigure->setLineColor(cFigure::BLACK);
29  addFigure(rectangleFigure);
30  addFigure(labelFigure);
31  setInset(inset);
32  setText(" "); // TODO: empty string causes negative width/height in Tkenv
33 }
double inset
Definition: BoxedLabelFigure.h:28
void setText(const char *text)
Definition: BoxedLabelFigure.cc:101
cRectangleFigure * rectangleFigure
Definition: BoxedLabelFigure.h:30
void setInset(double inset)
Definition: BoxedLabelFigure.cc:35
cLabelFigure * labelFigure
Definition: BoxedLabelFigure.h:29

Member Function Documentation

const cFigure::Color & inet::BoxedLabelFigure::getBackgroundColor ( ) const
87 {
88  return rectangleFigure->getFillColor();
89 }
cRectangleFigure * rectangleFigure
Definition: BoxedLabelFigure.h:30
const cFigure::Font & inet::BoxedLabelFigure::getFont ( ) const
67 {
68  return labelFigure->getFont();
69 }
cLabelFigure * labelFigure
Definition: BoxedLabelFigure.h:29
double inet::BoxedLabelFigure::getInset ( ) const
inline
38 { return inset; }
double inset
Definition: BoxedLabelFigure.h:28
const cFigure::Color & inet::BoxedLabelFigure::getLabelColor ( ) const
77 {
78  return labelFigure->getColor();
79 }
cLabelFigure * labelFigure
Definition: BoxedLabelFigure.h:29
cLabelFigure* inet::BoxedLabelFigure::getLabelFigure ( ) const
inline
35 { return labelFigure; }
cLabelFigure * labelFigure
Definition: BoxedLabelFigure.h:29
double inet::BoxedLabelFigure::getOpacity ( ) const
110 {
111  return rectangleFigure->getFillOpacity();
112 }
cRectangleFigure * rectangleFigure
Definition: BoxedLabelFigure.h:30
cRectangleFigure* inet::BoxedLabelFigure::getRectangleFigure ( ) const
inline

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

36 { return rectangleFigure; }
cRectangleFigure * rectangleFigure
Definition: BoxedLabelFigure.h:30
const char * inet::BoxedLabelFigure::getText ( ) const
97 {
98  return labelFigure->getText();
99 }
cLabelFigure * labelFigure
Definition: BoxedLabelFigure.h:29
void inet::BoxedLabelFigure::setAssociatedObject ( cObject *  object)

Referenced by inet::visualizer::InfoCanvasVisualizer::createInfoVisualization(), inet::visualizer::InterfaceTableCanvasVisualizer::createInterfaceVisualization(), and inet::visualizer::StatisticCanvasVisualizer::createStatisticVisualization().

56 {
57  labelFigure->setAssociatedObject(object);
58  rectangleFigure->setAssociatedObject(object);
59 }
cRectangleFigure * rectangleFigure
Definition: BoxedLabelFigure.h:30
cLabelFigure * labelFigure
Definition: BoxedLabelFigure.h:29
void inet::BoxedLabelFigure::setBackgroundColor ( cFigure::Color  color)
void inet::BoxedLabelFigure::setFont ( cFigure::Font  font)
void inet::BoxedLabelFigure::setInset ( double  inset)

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

36 {
37  this->inset = inset;
38  labelFigure->setPosition(cFigure::Point(inset, inset));
39  rectangleFigure->setCornerRx(inset);
40  rectangleFigure->setCornerRy(inset);
41 }
double inset
Definition: BoxedLabelFigure.h:28
cRectangleFigure * rectangleFigure
Definition: BoxedLabelFigure.h:30
cLabelFigure * labelFigure
Definition: BoxedLabelFigure.h:29
void inet::BoxedLabelFigure::setLabelColor ( cFigure::Color  color)
void inet::BoxedLabelFigure::setOpacity ( double  opacity)

Referenced by inet::visualizer::InfoCanvasVisualizer::createInfoVisualization(), inet::visualizer::InterfaceTableCanvasVisualizer::createInterfaceVisualization(), and inet::visualizer::StatisticCanvasVisualizer::createStatisticVisualization().

115 {
116  rectangleFigure->setFillOpacity(opacity);
117  rectangleFigure->setLineOpacity(opacity);
118  labelFigure->setOpacity(opacity);
119 }
cRectangleFigure * rectangleFigure
Definition: BoxedLabelFigure.h:30
cLabelFigure * labelFigure
Definition: BoxedLabelFigure.h:29
void inet::BoxedLabelFigure::setTags ( const char *  tags)
void inet::BoxedLabelFigure::setText ( const char *  text)

Referenced by BoxedLabelFigure(), inet::visualizer::InfoCanvasVisualizer::createInfoVisualization(), inet::visualizer::InterfaceTableCanvasVisualizer::createInterfaceVisualization(), inet::visualizer::StatisticCanvasVisualizer::createStatisticVisualization(), inet::visualizer::InfoCanvasVisualizer::refreshInfoVisualization(), inet::visualizer::InterfaceTableCanvasVisualizer::refreshInterfaceVisualization(), and inet::visualizer::StatisticCanvasVisualizer::refreshStatisticVisualization().

102 {
103  double width, height, ascent;
104  getSimulation()->getEnvir()->getTextExtent(labelFigure->getFont(), text, width, height, ascent);
105  rectangleFigure->setBounds(cFigure::Rectangle(0, 0, width + inset * 2, height + inset * 2));
106  labelFigure->setText(text);
107 }
double inset
Definition: BoxedLabelFigure.h:28
cRectangleFigure * rectangleFigure
Definition: BoxedLabelFigure.h:30
cLabelFigure * labelFigure
Definition: BoxedLabelFigure.h:29
void inet::BoxedLabelFigure::setTooltip ( const char *  tooltip)

Referenced by inet::visualizer::InfoCanvasVisualizer::createInfoVisualization(), inet::visualizer::InterfaceTableCanvasVisualizer::createInterfaceVisualization(), and inet::visualizer::StatisticCanvasVisualizer::createStatisticVisualization().

50 {
51  labelFigure->setTooltip(tooltip);
52  rectangleFigure->setTooltip(tooltip);
53 }
cRectangleFigure * rectangleFigure
Definition: BoxedLabelFigure.h:30
cLabelFigure * labelFigure
Definition: BoxedLabelFigure.h:29

Member Data Documentation

double inet::BoxedLabelFigure::inset = 3
protected

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

cLabelFigure* inet::BoxedLabelFigure::labelFigure
protected
cRectangleFigure* inet::BoxedLabelFigure::rectangleFigure
protected

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