Python cairo.LINE_CAP_BUTT Examples

The following are 10 code examples of cairo.LINE_CAP_BUTT(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module cairo , or try the search function .
Example #1
Source File: line.py    From RAFCON with Eclipse Public License 1.0 5 votes vote down vote up
def draw_head(self, context, port):
        offset = self._head_offset(port)
        length = self._head_length(port)
        cr = context.cairo
        cr.move_to(offset, 0)
        cr.line_to(offset + length, 0)
        cr.set_source_rgba(*self._arrow_color)
        cr.set_line_width(self._calc_line_width(port))
        cr.set_line_cap(LINE_CAP_BUTT)
        cr.stroke() 
Example #2
Source File: line.py    From RAFCON with Eclipse Public License 1.0 5 votes vote down vote up
def draw_tail(self, context, port):
        offset = self._head_offset(port)
        length = self._head_length(port)
        cr = context.cairo
        cr.move_to(offset, 0)
        cr.line_to(offset + length, 0)
        cr.set_source_rgba(*self._arrow_color)
        cr.set_line_width(self._calc_line_width(port))
        cr.set_line_cap(LINE_CAP_BUTT)
        cr.stroke() 
Example #3
Source File: xdot.py    From NoobSec-Toolkit with GNU General Public License v2.0 5 votes vote down vote up
def draw(self, cr, highlight_items=None):
        if highlight_items is None:
            highlight_items = ()
        cr.set_source_rgba(0.0, 0.0, 0.0, 1.0)

        cr.set_line_cap(cairo.LINE_CAP_BUTT)
        cr.set_line_join(cairo.LINE_JOIN_MITER)

        for shape in self.shapes:
            shape.draw(cr)
        for edge in self.edges:
            edge.draw(cr, highlight=(edge in highlight_items))
        for node in self.nodes:
            node.draw(cr, highlight=(node in highlight_items)) 
Example #4
Source File: xdot.py    From NoobSec-Toolkit with GNU General Public License v2.0 5 votes vote down vote up
def draw(self, cr, highlight_items=None):
        if highlight_items is None:
            highlight_items = ()
        cr.set_source_rgba(0.0, 0.0, 0.0, 1.0)

        cr.set_line_cap(cairo.LINE_CAP_BUTT)
        cr.set_line_join(cairo.LINE_JOIN_MITER)

        for shape in self.shapes:
            shape.draw(cr)
        for edge in self.edges:
            edge.draw(cr, highlight=(edge in highlight_items))
        for node in self.nodes:
            node.draw(cr, highlight=(node in highlight_items)) 
Example #5
Source File: xdot.py    From NoobSec-Toolkit with GNU General Public License v2.0 5 votes vote down vote up
def draw(self, cr, highlight_items=None):
        if highlight_items is None:
            highlight_items = ()
        cr.set_source_rgba(0.0, 0.0, 0.0, 1.0)

        cr.set_line_cap(cairo.LINE_CAP_BUTT)
        cr.set_line_join(cairo.LINE_JOIN_MITER)

        for shape in self.shapes:
            shape.draw(cr)
        for edge in self.edges:
            edge.draw(cr, highlight=(edge in highlight_items))
        for node in self.nodes:
            node.draw(cr, highlight=(node in highlight_items)) 
Example #6
Source File: xdot.py    From NoobSec-Toolkit with GNU General Public License v2.0 5 votes vote down vote up
def draw(self, cr, highlight_items=None):
        if highlight_items is None:
            highlight_items = ()
        cr.set_source_rgba(0.0, 0.0, 0.0, 1.0)

        cr.set_line_cap(cairo.LINE_CAP_BUTT)
        cr.set_line_join(cairo.LINE_JOIN_MITER)

        for shape in self.shapes:
            shape.draw(cr)
        for edge in self.edges:
            edge.draw(cr, highlight=(edge in highlight_items))
        for node in self.nodes:
            node.draw(cr, highlight=(node in highlight_items)) 
Example #7
Source File: xdot.py    From openxenmanager with GNU General Public License v2.0 5 votes vote down vote up
def draw(self, cr, highlight_items=None):
        if highlight_items is None:
            highlight_items = ()
        cr.set_source_rgba(0.0, 0.0, 0.0, 1.0)

        cr.set_line_cap(cairo.LINE_CAP_BUTT)
        cr.set_line_join(cairo.LINE_JOIN_MITER)

        for shape in self.shapes:
            shape.draw(cr)
        for edge in self.edges:
            edge.draw(cr, highlight=(edge in highlight_items))
        for node in self.nodes:
            node.draw(cr, highlight=(node in highlight_items)) 
Example #8
Source File: xdot.py    From POC-EXP with GNU General Public License v3.0 5 votes vote down vote up
def draw(self, cr, highlight_items=None):
        if highlight_items is None:
            highlight_items = ()
        cr.set_source_rgba(0.0, 0.0, 0.0, 1.0)

        cr.set_line_cap(cairo.LINE_CAP_BUTT)
        cr.set_line_join(cairo.LINE_JOIN_MITER)

        for shape in self.shapes:
            shape.draw(cr)
        for edge in self.edges:
            edge.draw(cr, highlight=(edge in highlight_items))
        for node in self.nodes:
            node.draw(cr, highlight=(node in highlight_items)) 
Example #9
Source File: xdot.py    From bokken with GNU General Public License v2.0 5 votes vote down vote up
def draw(self, cr, highlight_items=None):
        if highlight_items is None:
            highlight_items = ()
        cr.set_source_rgba(0.0, 0.0, 0.0, 1.0)

        cr.set_line_cap(cairo.LINE_CAP_BUTT)
        cr.set_line_join(cairo.LINE_JOIN_MITER)

        for shape in self.shapes:
            shape.draw(cr)
        for edge in self.edges:
            edge.draw(cr, highlight=(edge in highlight_items))
        for node in self.nodes:
            node.draw(cr, highlight=(node in highlight_items)) 
Example #10
Source File: xdot.py    From EasY_HaCk with Apache License 2.0 5 votes vote down vote up
def draw(self, cr, highlight_items=None):
        if highlight_items is None:
            highlight_items = ()
        cr.set_source_rgba(0.0, 0.0, 0.0, 1.0)

        cr.set_line_cap(cairo.LINE_CAP_BUTT)
        cr.set_line_join(cairo.LINE_JOIN_MITER)

        for shape in self.shapes:
            shape.draw(cr)
        for edge in self.edges:
            edge.draw(cr, highlight=(edge in highlight_items))
        for node in self.nodes:
            node.draw(cr, highlight=(node in highlight_items))