Пример #1
0
Файл: node.py Проект: lyma/core
 def __init__(
     self,
     app: "Application",
     x: float,
     y: float,
     core_node: core_pb2.Node,
     image: "PhotoImage",
 ):
     self.app = app
     self.canvas = app.canvas
     self.image = image
     self.core_node = core_node
     self.id = self.canvas.create_image(
         x, y, anchor=tk.CENTER, image=self.image, tags=tags.NODE
     )
     label_y = self._get_label_y()
     self.text_id = self.canvas.create_text(
         x,
         label_y,
         text=self.core_node.name,
         tags=tags.NODE_NAME,
         font=self.app.icon_text_font,
         fill="#0000CD",
     )
     self.tooltip = CanvasTooltip(self.canvas)
     self.edges = set()
     self.interfaces = []
     self.wireless_edges = set()
     self.antennas = []
     self.antenna_images = {}
     self.setup_bindings()
Пример #2
0
 def __init__(self, app: "Application", x: float, y: float, core_node: Node,
              image: PhotoImage):
     self.app: "Application" = app
     self.canvas: "CanvasGraph" = app.canvas
     self.image: PhotoImage = image
     self.core_node: Node = core_node
     self.id: int = self.canvas.create_image(x,
                                             y,
                                             anchor=tk.CENTER,
                                             image=self.image,
                                             tags=tags.NODE)
     label_y = self._get_label_y()
     label = self.get_label()
     self.text_id: int = self.canvas.create_text(
         x,
         label_y,
         text=label,
         tags=tags.NODE_LABEL,
         font=self.app.icon_text_font,
         fill="#0000CD",
         state=self.canvas.show_node_labels.state(),
     )
     self.tooltip: CanvasTooltip = CanvasTooltip(self.canvas)
     self.edges: Set[CanvasEdge] = set()
     self.ifaces: Dict[int, Interface] = {}
     self.wireless_edges: Set[CanvasWirelessEdge] = set()
     self.antennas: List[int] = []
     self.antenna_images: Dict[int, PhotoImage] = {}
     self.setup_bindings()
     self.context: tk.Menu = tk.Menu(self.canvas)
     themes.style_menu(self.context)
Пример #3
0
 def __init__(self, app, x, y, core_node, image):
     self.app = app
     self.canvas = app.canvas
     self.image = image
     self.core_node = core_node
     self.id = self.canvas.create_image(x,
                                        y,
                                        anchor=tk.CENTER,
                                        image=self.image,
                                        tags=tags.NODE)
     text_font = font.Font(family="TkIconFont", size=12)
     label_y = self._get_label_y()
     self.text_id = self.canvas.create_text(
         x,
         label_y,
         text=self.core_node.name,
         tags=tags.NODE_NAME,
         font=text_font,
         fill="#0000CD",
     )
     self.tooltip = CanvasTooltip(self.canvas)
     self.edges = set()
     self.interfaces = []
     self.wireless_edges = set()
     self.antennae = []
     self.setup_bindings()
Пример #4
0
Файл: node.py Проект: lsh23/core
 def __init__(
     self,
     app: "Application",
     x: float,
     y: float,
     core_node: core_pb2.Node,
     image: "PhotoImage",
 ):
     self.app = app
     self.canvas = app.canvas
     self.image = image
     self.core_node = core_node
     self.id = self.canvas.create_image(x,
                                        y,
                                        anchor=tk.CENTER,
                                        image=self.image,
                                        tags=tags.NODE)
     label_y = self._get_label_y()
     self.text_id = self.canvas.create_text(
         x,
         label_y,
         text=self.core_node.name,
         tags=tags.NODE_LABEL,
         font=self.app.icon_text_font,
         fill="#0000CD",
         state=self.canvas.show_node_labels.state(),
     )
     self.tooltip = CanvasTooltip(self.canvas)
     self.edges = set()
     self.interfaces = []
     self.wireless_edges = set()
     self.antennas = []
     self.antenna_images = {}
     # possible configurations
     self.emane_model_configs = {}
     self.wlan_config = {}
     self.mobility_config = {}
     self.service_configs = {}
     self.service_file_configs = {}
     self.config_service_configs = {}
     self.setup_bindings()
     self.context = tk.Menu(self.canvas)
     themes.style_menu(self.context)
Пример #5
0
 def __init__(
     self, app: "Application", x: float, y: float, core_node: Node, image: PhotoImage
 ):
     self.app: "Application" = app
     self.canvas: "CanvasGraph" = app.canvas
     self.image: PhotoImage = image
     self.core_node: Node = core_node
     self.id: int = self.canvas.create_image(
         x, y, anchor=tk.CENTER, image=self.image, tags=tags.NODE
     )
     label_y = self._get_label_y()
     label = self.get_label()
     self.text_id: int = self.canvas.create_text(
         x,
         label_y,
         text=label,
         tags=tags.NODE_LABEL,
         font=self.app.icon_text_font,
         fill="#0000CD",
         state=self.canvas.show_node_labels.state(),
     )
     self.tooltip: CanvasTooltip = CanvasTooltip(self.canvas)
     self.edges: Set[CanvasEdge] = set()
     self.ifaces: Dict[int, Interface] = {}
     self.wireless_edges: Set[CanvasWirelessEdge] = set()
     self.antennas: List[int] = []
     self.antenna_images: Dict[int, PhotoImage] = {}
     # possible configurations
     self.emane_model_configs: Dict[
         Tuple[str, Optional[int]], Dict[str, ConfigOption]
     ] = {}
     self.wlan_config: Dict[str, ConfigOption] = {}
     self.mobility_config: Dict[str, ConfigOption] = {}
     self.service_configs: Dict[str, NodeServiceData] = {}
     self.service_file_configs: Dict[str, Dict[str, str]] = {}
     self.config_service_configs: Dict[str, Any] = {}
     self.setup_bindings()
     self.context: tk.Menu = tk.Menu(self.canvas)
     themes.style_menu(self.context)