def METHOD_NAME(self, event):
    """
    Handles all mouse press events.
    :param event: QMouseEvent instance
    """
    self.update()
    if self._isHorizontalLine():
        if event.pos().x() > (self.line().x2() - self._border):
            self.setFlag(QtWidgets.QGraphicsItem.ItemIsMovable, False)
            self._edge = "right"
        elif event.pos().x() < (self.line().x1() + self._border):
            self.setFlag(QtWidgets.QGraphicsItem.ItemIsMovable, False)
            self._edge = "left"
    else:
        if event.pos().y() > (self.line().y2() - self._border):
            self.setFlag(QtWidgets.QGraphicsItem.ItemIsMovable, False)
            self._edge = "top"
        elif event.pos().y() < (self.line().y1() + self._border):
            self.setFlag(QtWidgets.QGraphicsItem.ItemIsMovable, False)
            self._edge = "bottom"
    super().METHOD_NAME(event)