A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
visualizer.core.Node Class Reference

Node class. More...

+ Inheritance diagram for visualizer.core.Node:
+ Collaboration diagram for visualizer.core.Node:

Public Member Functions

def __init__ (self, visualizer, node_index)
 Initialize function.
 
def add_link (self, link)
 Add link function.
 
def get_position (self)
 Get position function.
 
def has_mobility (self)
 Has mobility function.
 
def on_enter_notify_event (self, view, target, event)
 On Enter event handle.
 
def on_leave_notify_event (self, view, target, event)
 On Leave event handle.
 
def remove_link (self, link)
 Remove link function.
 
def set_color (self, color)
 Set color function.
 
def set_label (self, label)
 Set a label for the node.
 
def set_position (self, x, y)
 Set position function.
 
def set_size (self, size)
 Set size function.
 
def set_svg_icon (self, file_base_name, width=None, height=None, align_x=0.5, align_y=0.5)
 Set a background SVG icon for the node.
 
def tooltip_query (self, tooltip)
 Query tooltip.
 
def tooltip_query (self, tooltip)
 Returns tooltip text string.
 

Public Attributes

 canvas_item
 canvas item
 
 highlighted
 highlighted property
 
 links
 links
 
 menu
 menu
 
 node_index
 node index
 
 svg_align_x
 svg align X
 
 svg_align_y
 svg align Y
 
 svg_item
 svg item
 
 visualizer
 visualier object
 

Protected Member Functions

def _get_highlighted (self)
 Get highlighted function.
 
def _get_selected (self)
 Get selected function.
 
def _set_highlighted (self, value)
 Set highlighted function.
 
def _set_selected (self, value)
 Set selected function.
 
def _update_appearance (self)
 Update the node aspect to reflect the selected/highlighted state.
 
def _update_position (self)
 Update position function.
 
def _update_svg_position (self, x, y)
 Update svg position.
 

Protected Attributes

 _color
 color
 
 _has_mobility
 has mobility model
 
 _highlighted
 is highlighted
 
 _label
 label
 
 _label_canvas_item
 label canvas
 
 _selected
 is selected
 
 _size
 size
 

Properties

property highlighted = property(_get_highlighted, _set_highlighted)
 highlighted property
 
property selected = property(_get_selected, _set_selected)
 selected property
 

Static Private Attributes

dict __gsignals__
 signal emitted whenever a tooltip is about to be shown for the node the first signal parameter is a python list of strings, to which information can be appended
 

Detailed Description

Node class.

Definition at line 95 of file core.py.

Constructor & Destructor Documentation

◆ __init__()

def visualizer.core.Node.__init__ (   self,
  visualizer,
  node_index 
)

Initialize function.

Parameters
selfThe object pointer.
visualizervisualizer object
node_indexnode index

Definition at line 142 of file core.py.

References visualizer.core.Node.__init__().

Referenced by visualizer.core.Node.__init__().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Function Documentation

◆ _get_highlighted()

def visualizer.core.Node._get_highlighted (   self)
protected

Get highlighted function.

Parameters
selfclass object.
Returns
highlighted status

Definition at line 377 of file core.py.

References visualizer.core.Node._highlighted.

◆ _get_selected()

def visualizer.core.Node._get_selected (   self)
protected

Get selected function.

Parameters
selfclass object.
Returns
selected status

Definition at line 355 of file core.py.

References visualizer.core.Node._selected.

◆ _set_highlighted()

def visualizer.core.Node._set_highlighted (   self,
  value 
)
protected

Set highlighted function.

Parameters
selfclass object.
valueselected value
Returns
none

Definition at line 366 of file core.py.

References visualizer.core.Node._highlighted, and visualizer.core.Node._update_appearance().

+ Here is the call graph for this function:

◆ _set_selected()

def visualizer.core.Node._set_selected (   self,
  value 
)
protected

Set selected function.

Parameters
selfclass object.
valueselected value
Returns
none

Definition at line 344 of file core.py.

References visualizer.core.Node._selected, and visualizer.core.Node._update_appearance().

+ Here is the call graph for this function:

◆ _update_appearance()

◆ _update_position()

def visualizer.core.Node._update_position (   self)
protected

Update position function.

Parameters
selfclass object.
Returns
none

Definition at line 496 of file core.py.

References visualizer.core.Node.get_position(), visualizer.core.Channel.get_position(), grid.ScaleRenderer.get_position(), visualizer.core.Node.set_position(), and visualizer.core.Channel.set_position().

Referenced by visualizer.core.Node._update_appearance().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _update_svg_position()

def visualizer.core.Node._update_svg_position (   self,
  x,
  y 
)
protected

Update svg position.

Parameters
selfclass object.
xx position
yy position
Returns
none

Definition at line 230 of file core.py.

References visualizer.core.Node.svg_align_x, visualizer.core.Node.svg_align_y, and visualizer.core.Node.svg_item.

Referenced by visualizer.core.Node.set_position(), and visualizer.core.Node.set_svg_icon().

+ Here is the caller graph for this function:

◆ add_link()

def visualizer.core.Node.add_link (   self,
  link 
)

Add link function.

Parameters
selfclass object.
linklink to add.
Returns
none

Definition at line 525 of file core.py.

References visualizer.core.Node.links, and visualizer.core.Channel.links.

◆ get_position()

def visualizer.core.Node.get_position (   self)

Get position function.

Parameters
selfclass object.
Returns
x and y position

Definition at line 484 of file core.py.

References visualizer.core.Node.canvas_item, visualizer.core.Channel.canvas_item, visualizer.core.WiredLink.canvas_item, and wifi_intrastructure_link.WifiLink.canvas_item.

Referenced by visualizer.core.Node._update_position().

+ Here is the caller graph for this function:

◆ has_mobility()

def visualizer.core.Node.has_mobility (   self)

◆ on_enter_notify_event()

visualizer.core.Node.on_enter_notify_event (   self,
  view,
  target,
  event 
)

On Enter event handle.

on_enter_notify_event function

Parameters
selfclass object.
viewview
targettarget
eventevent
Returns
none

Definition at line 318 of file core.py.

◆ on_leave_notify_event()

visualizer.core.Node.on_leave_notify_event (   self,
  view,
  target,
  event 
)

On Leave event handle.

on_leave_notify_event function

Parameters
selfclass object.
viewview
targettarget
eventevent
Returns
none

Definition at line 332 of file core.py.

References visualizer.core.Node.highlighted.

◆ remove_link()

def visualizer.core.Node.remove_link (   self,
  link 
)

Remove link function.

Parameters
selfclass object.
linklink to add.
Returns
none

Definition at line 536 of file core.py.

References visualizer.core.Node.links, and visualizer.core.Channel.links.

◆ set_color()

def visualizer.core.Node.set_color (   self,
  color 
)

Set color function.

Parameters
selfclass object.
colorcolor to set.
Returns
none

Definition at line 506 of file core.py.

References visualizer.core.Node._color, and visualizer.core.Node._update_appearance().

+ Here is the call graph for this function:

◆ set_label()

def visualizer.core.Node.set_label (   self,
  label 
)

Set a label for the node.

Parameters
selfclass object.
labellabel to set
Returns
: an exception if invalid parameter.

Definition at line 217 of file core.py.

References visualizer.core.Node._label, and visualizer.core.Node._update_appearance().

+ Here is the call graph for this function:

◆ set_position()

def visualizer.core.Node.set_position (   self,
  x,
  y 
)

Set position function.

Parameters
selfclass object.
xx position
yy position
Returns
none

Definition at line 444 of file core.py.

References visualizer.core.Node._label_canvas_item, visualizer.core.Node._size, visualizer.core.Node._update_svg_position(), visualizer.core.Node.canvas_item, visualizer.core.Channel.canvas_item, visualizer.core.WiredLink.canvas_item, wifi_intrastructure_link.WifiLink.canvas_item, visualizer.core.Node.links, visualizer.core.Channel.links, visualizer.core.Node.svg_item, visualizer.core.Node.visualizer, interface_statistics.StatisticsCollector.visualizer, interface_statistics.ShowInterfaceStatistics.visualizer, ipv4_routing_table.ShowIpv4RoutingTable.visualizer, olsr.ShowOlsrRoutingTable.visualizer, and show_last_packets.ShowLastPackets.visualizer.

Referenced by visualizer.core.Node._update_position().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_size()

def visualizer.core.Node.set_size (   self,
  size 
)

Set size function.

Parameters
selfclass object.
sizeselected size
Returns
none

Definition at line 388 of file core.py.

References visualizer.core.Node._size, and visualizer.core.Node._update_appearance().

+ Here is the call graph for this function:

◆ set_svg_icon()

def visualizer.core.Node.set_svg_icon (   self,
  file_base_name,
  width = None,
  height = None,
  align_x = 0.5,
  align_y = 0.5 
)

Set a background SVG icon for the node.

Parameters
file_base_namebase file name, including .svg extension, of the svg file. Place the file in the folder src/contrib/visualizer/resource.
widthscale to the specified width, in meters
heightscale to the specified height, in meters
align_xhorizontal alignment of the icon relative to the node position, from 0 (icon fully to the left of the node) to 1.0 (icon fully to the right of the node)
align_yvertical alignment of the icon relative to the node position, from 0 (icon fully to the top of the node) to 1.0 (icon fully to the bottom of the node)
Returns
a ValueError exception if invalid dimensions.

Definition at line 171 of file core.py.

References visualizer.core.Node._update_appearance(), visualizer.core.Node._update_svg_position(), visualizer.core.Node.canvas_item, visualizer.core.Channel.canvas_item, visualizer.core.WiredLink.canvas_item, wifi_intrastructure_link.WifiLink.canvas_item, visualizer.core.Node.svg_align_x, visualizer.core.Node.svg_align_y, visualizer.core.Node.svg_item, visualizer.core.Node.visualizer, interface_statistics.StatisticsCollector.visualizer, interface_statistics.ShowInterfaceStatistics.visualizer, ipv4_routing_table.ShowIpv4RoutingTable.visualizer, olsr.ShowOlsrRoutingTable.visualizer, and show_last_packets.ShowLastPackets.visualizer.

+ Here is the call graph for this function:

◆ tooltip_query()

Member Data Documentation

◆ __gsignals__

dict visualizer.core.Node.__gsignals__
staticprivate
Initial value:
= {
"query-extra-tooltip-info": (GObject.SignalFlags.RUN_LAST, None, (object,)),
}

signal emitted whenever a tooltip is about to be shown for the node the first signal parameter is a python list of strings, to which information can be appended

Definition at line 138 of file core.py.

◆ _color

visualizer.core.Node._color
protected

color

Definition at line 158 of file core.py.

Referenced by visualizer.core.Node._update_appearance(), and visualizer.core.Node.set_color().

◆ _has_mobility

visualizer.core.Node._has_mobility
protected

has mobility model

Definition at line 155 of file core.py.

Referenced by visualizer.core.Node.has_mobility().

◆ _highlighted

visualizer.core.Node._highlighted
protected

is highlighted

Definition at line 157 of file core.py.

Referenced by visualizer.core.Node._get_highlighted(), and visualizer.core.Node._set_highlighted().

◆ _label

visualizer.core.Node._label
protected

label

Definition at line 166 of file core.py.

Referenced by visualizer.core.Node._update_appearance(), and visualizer.core.Node.set_label().

◆ _label_canvas_item

visualizer.core.Node._label_canvas_item
protected

label canvas

Definition at line 167 of file core.py.

Referenced by visualizer.core.Node._update_appearance(), and visualizer.core.Node.set_position().

◆ _selected

visualizer.core.Node._selected
protected

◆ _size

visualizer.core.Node._size
protected

◆ canvas_item

◆ highlighted

visualizer.core.Node.highlighted

highlighted property

Definition at line 330 of file core.py.

Referenced by visualizer.core.Node._update_appearance(), and visualizer.core.Node.on_leave_notify_event().

◆ links

◆ menu

visualizer.core.Node.menu

menu

Definition at line 162 of file core.py.

◆ node_index

◆ svg_align_x

visualizer.core.Node.svg_align_x

svg align X

Definition at line 164 of file core.py.

Referenced by visualizer.core.Node._update_svg_position(), and visualizer.core.Node.set_svg_icon().

◆ svg_align_y

visualizer.core.Node.svg_align_y

svg align Y

Definition at line 165 of file core.py.

Referenced by visualizer.core.Node._update_svg_position(), and visualizer.core.Node.set_svg_icon().

◆ svg_item

◆ visualizer

Property Documentation

◆ highlighted

visualizer.core.Node.highlighted = property(_get_highlighted, _set_highlighted)
static

highlighted property

Definition at line 386 of file core.py.

Referenced by visualizer.core.Node._update_appearance(), and visualizer.core.Node.on_leave_notify_event().

◆ selected

visualizer.core.Node.selected = property(_get_selected, _set_selected)
static

selected property

Definition at line 364 of file core.py.


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