Esempio n. 1
0
    def finish_stroke(self, stroke):
        """
        Finish a stroke, that was created with new_unfinished_stroke() and
        send it to the server, if connected.

        Positional arguments:
        stroke -- The Stroke object, that was finished
        """
        history.register_draw_stroke(stroke, self)
        stroke.calculate_bounding_box()
        network.new_stroke(self.number, stroke)
Esempio n. 2
0
File: page.py Progetto: KaiQ/cournal
 def finish_stroke(self, stroke):
     """
     Finish a stroke, that was created with new_unfinished_stroke() and
     send it to the server, if connected.
     
     Positional arguments:
     stroke -- The Stroke object, that was finished
     """
     history.register_draw_stroke(stroke, self)
     stroke.calculate_bounding_box()
     network.new_stroke(self.number, stroke)
Esempio n. 3
0
    def new_stroke(self, stroke, send_to_network=False):
        """
        Add a new stroke to this page and possibly send it to the server, if
        connected.

        Positional arguments:
        stroke -- The Stroke object, that will be added to this page

        Keyword arguments:
        send_to_network -- Set True, to send the stroke to the server
                           (defaults to False)
        """
        self.layers[0].strokes.append(stroke)
        stroke.calculate_bounding_box()
        stroke.layer = self.layers[0]
        if self.widget:
            self.widget.draw_remote_stroke(stroke)
        if send_to_network:
            network.new_stroke(self.number, stroke)
Esempio n. 4
0
File: page.py Progetto: KaiQ/cournal
 def new_stroke(self, stroke, send_to_network=False):
     """
     Add a new stroke to this page and possibly send it to the server, if
     connected.
     
     Positional arguments:
     stroke -- The Stroke object, that will be added to this page
     
     Keyword arguments:
     send_to_network -- Set True, to send the stroke to the server
                        (defaults to False)
     """
     self.layers[0].strokes.append(stroke)
     stroke.calculate_bounding_box()
     stroke.layer = self.layers[0]
     if self.widget:
         self.widget.draw_remote_stroke(stroke)
     if send_to_network:
         network.new_stroke(self.number, stroke)