How to use the gaphas.connector.Handle function in gaphas

To help you get started, we’ve selected a few gaphas examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DLR-RM / RAFCON / source / rafcon / gui / mygaphas / items / ports.py View on Github external
def __init__(self, in_port, name=None, parent=None, side=SnappedSide.RIGHT):
        self.handle = Handle(connectable=True)
        self.port = RectanglePointPort(self.handle.pos, self)
        self._is_in_port = in_port
        self._side = None
        self.direction = None
        self.side = side
        self._parent = ref(parent)
        self._view = None

        self.text_color = gui_config.gtk_colors['LABEL']
        self.fill_color = gui_config.gtk_colors['LABEL']

        self._incoming_handles = []
        self._outgoing_handles = []
        self._connected_connections = []
        self._tmp_incoming_connected = False
        self._tmp_outgoing_connected = False
github DLR-RM / RAFCON / source / rafcon / gui / mygaphas / items / ports.py View on Github external
def add_connected_handle(self, handle, connection_view, moving=False):
        from rafcon.gui.mygaphas.items.connection import ConnectionView
        assert isinstance(handle, Handle)
        assert isinstance(connection_view, ConnectionView)
        if not moving and handle is connection_view.from_handle() and handle not in self._outgoing_handles:
            self._outgoing_handles.append(handle)
            self._add_connection(connection_view)
        elif not moving and handle is connection_view.to_handle() and handle not in self._incoming_handles:
            self._incoming_handles.append(handle)
            self._add_connection(connection_view)
github DLR-RM / RAFCON / source / rafcon / gui / mygaphas / items / ports.py View on Github external
def add_connected_handle(self, handle, connection_view, moving=False):
        from rafcon.gui.mygaphas.items.connection import ConnectionView
        assert isinstance(handle, Handle)
        assert isinstance(connection_view, ConnectionView)
        if not moving and handle is connection_view.from_handle() and handle not in self._outgoing_handles:
            self._outgoing_handles.append(handle)
            self._add_connection(connection_view)
        elif not moving and handle is connection_view.to_handle() and handle not in self._incoming_handles:
            self._incoming_handles.append(handle)
            self._add_connection(connection_view)
github DLR-RM / RAFCON / source / rafcon / gui / mygaphas / items / ports.py View on Github external
def __init__(self, in_port, name=None, parent=None, side=SnappedSide.RIGHT):
        self.handle = Handle(connectable=True)
        self.port = RectanglePointPort(self.handle.pos, self)
        self._is_in_port = in_port
        self._side = None
        self.direction = None
        self.side = side
        self._parent = ref(parent)
        self._view = None

        self.text_color = gui_config.gtk_colors['LABEL']
        self.fill_color = gui_config.gtk_colors['LABEL']

        self._incoming_handles = []
        self._outgoing_handles = []
        self.connected_connections = []
        self._tmp_incoming_connected = False
        self._tmp_outgoing_connected = False
github gaphor / gaphor / gaphor / diagram / interactions / lifeline.py View on Github external
def __init__(self):
        super().__init__()

        self.top = Handle(strength=STRONG - 1)
        self.bottom = Handle(strength=STRONG)

        self.top.movable = False
        self.top.visible = False

        self.port = LifetimePort(self.top.pos, self.bottom.pos)
        self.visible = False

        self._c_min_length = None  # to be set by lifeline item
github DLR-RM / RAFCON / source / awesome_tool / mvc / views / gap / scope.py View on Github external
self.min_width = 0.0001
        self.min_height = 0.0001
        self.width = size[0]
        self.height = size[1]

        left_center = (0, self.height / 2.)
        right_center = (self.width, self.height / 2.)
        
        input_handle = Handle(left_center, connectable=True, movable=False)
        self._handles.append(input_handle)
        self._input_handle = input_handle
        input_port = PointPort(input_handle.pos)
        self._input_port = input_port
        self._ports.append(input_port)
        
        output_handle = Handle(right_center, connectable=True, movable=False)
        self._handles.append(output_handle)
        self._output_handle = output_handle
        output_port = PointPort(output_handle.pos)
        self._output_port = output_port
        self._ports.append(output_port)

        self.constraint(line=(input_handle.pos, (self._handles[NW].pos, self._handles[SW].pos)), align=0.5)
        self.constraint(line=(output_handle.pos, (self._handles[NE].pos, self._handles[SE].pos)), align=0.5)
github DLR-RM / RAFCON / source / awesome_tool / mvc / views / gap / scope.py View on Github external
def __init__(self, scoped_variable_m, size):
        super(ScopedVariableView, self).__init__(size[0], size[1])
        assert isinstance(scoped_variable_m, ScopedVariableModel)

        self._scoped_variable_m = ref(scoped_variable_m)

        self.min_width = 0.0001
        self.min_height = 0.0001
        self.width = size[0]
        self.height = size[1]

        left_center = (0, self.height / 2.)
        right_center = (self.width, self.height / 2.)
        
        input_handle = Handle(left_center, connectable=True, movable=False)
        self._handles.append(input_handle)
        self._input_handle = input_handle
        input_port = PointPort(input_handle.pos)
        self._input_port = input_port
        self._ports.append(input_port)
        
        output_handle = Handle(right_center, connectable=True, movable=False)
        self._handles.append(output_handle)
        self._output_handle = output_handle
        output_port = PointPort(output_handle.pos)
        self._output_port = output_port
        self._ports.append(output_port)

        self.constraint(line=(input_handle.pos, (self._handles[NW].pos, self._handles[SW].pos)), align=0.5)
        self.constraint(line=(output_handle.pos, (self._handles[NE].pos, self._handles[SE].pos)), align=0.5)
github gaphor / gaphor / gaphor / diagram / interactions / lifeline.py View on Github external
def __init__(self):
        super().__init__()

        self.top = Handle(strength=STRONG - 1)
        self.bottom = Handle(strength=STRONG)

        self.top.movable = False
        self.top.visible = False

        self.port = LifetimePort(self.top.pos, self.bottom.pos)
        self.visible = False

        self._c_min_length = None  # to be set by lifeline item