Example #1
0
def draw_initial_node(_box, context, _bounding_box):
    cr = context.cairo
    r = 10
    d = r * 2
    path_ellipse(cr, r, r, d, d)
    cr.set_line_width(0.01)
    cr.fill()
Example #2
0
def draw_usecase(box, context, bounding_box):
    cr = context.cairo

    rx = bounding_box.width / 2.0
    ry = bounding_box.height / 2.0

    cr.move_to(bounding_box.width, ry)
    path_ellipse(cr, rx, ry, bounding_box.width, bounding_box.height)
    stroke(context)
Example #3
0
    def draw(self, context):
        cr = context.cairo
        r = self.RADIUS
        d = r * 2
        path_ellipse(cr, r, r, d, d)
        cr.set_line_width(0.01)
        cr.fill()

        super(InitialNodeItem, self).draw(context)
Example #4
0
 def draw(self, context):
     cr = context.cairo
     r = self.RADIUS
     d = r * 2
     path_ellipse(cr, r, r, d, d)
     cr.set_line_width(0.01)
     cr.fill()
     
     super(InitialNodeItem, self).draw(context)
Example #5
0
    def draw(self, context):
        cr = context.cairo

        rx = self.width / 2.0
        ry = self.height / 2.0

        cr.move_to(self.width, ry)
        path_ellipse(cr, rx, ry, self.width, self.height)
        stroke(context)
Example #6
0
def draw_initial_pseudostate(box, context, bounding_box):
    """
    Draw intial pseudostate symbol.
    """
    cr = context.cairo
    r = 10
    d = r * 2
    path_ellipse(cr, r, r, d, d)
    cr.set_line_width(0.01)
    cr.fill()
    def draw(self, context):
        cr = context.cairo
        path_ellipse(cr, 0, 0, 2 * self.radius, 2 * self.radius)

        if context.hovered:
            cr.set_source_rgba(*self.colour_hovered)
        else:
            cr.set_source_rgba(*self.colour)
        cr.fill_preserve()
        #cr.set_source_rgb(0, 0, 0.8)
        cr.stroke()
Example #8
0
 def draw(self, context):
     """
     Draw intial pseudostate symbol.
     """
     super(InitialPseudostateItem, self).draw(context)
     cr = context.cairo
     r = self.RADIUS
     d = r * 2
     path_ellipse(cr, r, r, d, d)
     cr.set_line_width(0.01)
     cr.fill()
Example #9
0
def draw_initial_node(_box, context, _bounding_box):
    cr = context.cairo
    stroke = context.style["color"]
    if stroke:
        cr.set_source_rgba(*stroke)

    r = 10
    d = r * 2
    path_ellipse(cr, r, r, d, d)
    cr.set_line_width(0.01)
    cr.fill()
Example #10
0
    def draw(self, context):
        cr = context.cairo

        rx = old_div(self.width, 2.)
        ry = old_div(self.height, 2.)

        cr.move_to(self.width, ry)
        path_ellipse(cr, rx, ry, self.width, self.height)
        cr.stroke()

        super(UseCaseItem, self).draw(context)
Example #11
0
def draw_initial_pseudostate(box, context, bounding_box):
    """Draw initial pseudostate symbol."""
    cr = context.cairo
    stroke = context.style["color"]
    if stroke:
        cr.set_source_rgba(*stroke)
    r = 10
    d = r * 2
    path_ellipse(cr, r, r, d, d)
    cr.set_line_width(0.01)
    cr.fill()
Example #12
0
    def draw(self, context):
        cr = context.cairo

        rx = self.width / 2. 
        ry = self.height / 2.

        cr.move_to(self.width, ry)
        path_ellipse(cr, rx, ry, self.width, self.height)
        cr.stroke()

        super(UseCaseItem, self).draw(context)
Example #13
0
    def draw(self, context):
        cr = context.cairo

        rx = self.width / 2.0
        ry = self.height / 2.0

        cr.move_to(self.width, ry)
        path_ellipse(cr, rx, ry, self.width, self.height)
        cr.stroke()

        super(UseCaseItem, self).draw(context)
Example #14
0
 def draw(self, context):
     """
     Draw intial pseudostate symbol.
     """
     super(InitialPseudostateItem, self).draw(context)
     cr = context.cairo
     r = self.RADIUS
     d = r * 2
     path_ellipse(cr, r, r, d, d)
     cr.set_line_width(0.01)
     cr.fill()
Example #15
0
 def draw(self, context):
     """
     Draw intial pseudostate symbol.
     """
     super(HistoryPseudostateItem, self).draw(context)
     cr = context.cairo
     r = self.RADIUS
     d = r * 2
     path_ellipse(cr, r, r, d, d)
     #cr.set_line_width(1)
     cr.stroke()
     text_center(cr, r, r, "H")
Example #16
0
 def draw(self, context):
     """
     Draw intial pseudostate symbol.
     """
     super(HistoryPseudostateItem, self).draw(context)
     cr = context.cairo
     r = self.RADIUS
     d = r * 2
     path_ellipse(cr, r, r, d, d)
     # cr.set_line_width(1)
     cr.stroke()
     text_center(cr, r, r, "H", self.style.name_font)
Example #17
0
    def draw(self, context):
        cr = context.cairo
        style = self.style

        rx = self.width / 2.0
        ry = self.height / 2.0

        cr.move_to(self.width, ry)
        path_ellipse(cr, rx, ry, self.width, self.height)
        cr.set_source_rgba(*style("color"))
        cr.set_line_width(style("line-width"))
        cr.stroke()
Example #18
0
def draw_history_pseudostate(box, context, bounding_box):
    cr = context.cairo
    r = 15
    d = r * 2
    path_ellipse(cr, r, r, d, d)
    # cr.set_line_width(1)
    cr.move_to(12, 10)
    cr.line_to(12, 20)
    cr.move_to(18, 10)
    cr.line_to(18, 20)
    cr.move_to(12, 15)
    cr.line_to(18, 15)
    cr.stroke()
Example #19
0
def draw_final_state(box, context, bounding_box):
    cr = context.cairo
    r = 16
    d = 20
    path_ellipse(cr, r, r, d, d)
    cr.set_line_width(0.01)
    cr.fill()

    d = r * 2
    path_ellipse(cr, r, r, d, d)
    cr.set_line_width(0.01)
    cr.set_line_width(2)
    cr.stroke()
Example #20
0
def draw_flow_final_node(_box, context, _bounding_box):
    cr = context.cairo
    r = 10
    d = r * 2
    path_ellipse(cr, r, r, d, d)
    cr.stroke()

    dr = (1 - math.sin(math.pi / 4)) * r
    cr.move_to(dr, dr)
    cr.line_to(d - dr, d - dr)
    cr.move_to(dr, d - dr)
    cr.line_to(d - dr, dr)
    cr.stroke()
Example #21
0
def draw_database(box, context, bounding_box):
    cr = context.cairo
    d = 0.38
    x, y, width, height = bounding_box

    x1 = width + x
    y1 = height + y
    cr.move_to(x1, y)
    path_ellipse(cr, width / 2, y, width, height * d)
    cr.line_to(x1, y1)
    cr.curve_to(x1, y1, width / 2, y1 + height * d, x, y1)
    cr.line_to(x, y)

    stroke(context)
Example #22
0
def draw_history_pseudostate(box, context, bounding_box):
    cr = context.cairo
    r = 15
    d = r * 2
    path_ellipse(cr, r, r, d, d)
    stroke(context)

    cr.move_to(12, 10)
    cr.line_to(12, 20)
    cr.move_to(18, 10)
    cr.line_to(18, 20)
    cr.move_to(12, 15)
    cr.line_to(18, 15)
    stroke(context, fill=False)
Example #23
0
    def draw(self, context):
        cr = context.cairo
        r = self.RADIUS
        d = r * 2
        path_ellipse(cr, r, r, d, d)
        cr.stroke()

        dr = (1 - math.sin(math.pi / 4)) * r
        cr.move_to(dr, dr)
        cr.line_to(d - dr, d - dr)
        cr.move_to(dr, d - dr)
        cr.line_to(d - dr, dr)
        cr.stroke()

        super(FlowFinalNodeItem, self).draw(context)
Example #24
0
    def draw(self, context):
        cr = context.cairo
        nw = self._handles[NW]
        style = self.style

        rx = self.width / 2.0
        ry = self.height / 2.0

        cr.move_to(self.width, ry)
        path_ellipse(cr, rx, ry, self.width, self.height)
        cr.set_source_rgba(*style.fill_color)
        cr.fill_preserve()
        cr.set_source_rgba(*style.border_color)
        cr.set_line_width(style.border_width)
        cr.stroke()
Example #25
0
    def draw(self, context):
        cr = context.cairo
        r = self.RADIUS
        d = r * 2
        path_ellipse(cr, r, r, d, d)
        cr.stroke()

        dr = (1 - math.sin(math.pi / 4)) * r
        cr.move_to(dr, dr)
        cr.line_to(d - dr, d - dr)
        cr.move_to(dr, d - dr)
        cr.line_to(d - dr, dr)
        cr.stroke()
        
        super(FlowFinalNodeItem, self).draw(context)
Example #26
0
    def draw(self, context):
        cr = context.cairo
        r = self.RADIUS_2 + 1
        d = self.RADIUS_1 * 2
        path_ellipse(cr, r, r, d, d)
        cr.set_line_width(0.01)
        cr.fill()

        d = r * 2
        path_ellipse(cr, r, r, d, d)
        cr.set_line_width(0.01)
        cr.set_line_width(2)
        cr.stroke()

        super(ActivityFinalNodeItem, self).draw(context)
Example #27
0
    def draw(self, context):
        cr = context.cairo
        r = self.RADIUS_2 + 1
        d = self.RADIUS_1 * 2
        path_ellipse(cr, r, r, d, d)
        cr.set_line_width(0.01)
        cr.fill()

        d = r * 2
        path_ellipse(cr, r, r, d, d)
        cr.set_line_width(0.01)
        cr.set_line_width(2)
        cr.stroke()

        super(ActivityFinalNodeItem, self).draw(context)
Example #28
0
def draw_activity_final_node(_box, context, _bounding_box):
    cr = context.cairo
    inner_radius = 10
    outer_radius = 15

    r = outer_radius + 1
    d = inner_radius * 2
    path_ellipse(cr, r, r, d, d)
    cr.set_line_width(0.01)
    cr.fill()

    d = r * 2
    path_ellipse(cr, r, r, d, d)
    cr.set_line_width(0.01)
    cr.set_line_width(2)
    cr.stroke()
Example #29
0
def draw_final_state(box, context, bounding_box):
    cr = context.cairo
    r = 15

    d = r * 2
    path_ellipse(cr, r, r, d, d)
    cr.set_line_width(0.01)
    cr.set_line_width(2)
    stroke(context)

    stroke_color = context.style["color"]
    if stroke_color:
        cr.set_source_rgba(*stroke_color)

    d = 20
    path_ellipse(cr, r, r, d, d)
    cr.set_line_width(0.01)
    cr.fill()
Example #30
0
    def draw(self, context):
        """
        Draw final state symbol.
        """
        cr = context.cairo
        r = self.RADIUS_2 + 1
        d = self.RADIUS_1 * 2
        path_ellipse(cr, r, r, d, d)
        cr.set_line_width(0.01)
        cr.fill()

        d = r * 2
        path_ellipse(cr, r, r, d, d)
        cr.set_line_width(0.01)
        cr.set_line_width(2)
        cr.stroke()

        super(FinalStateItem, self).draw(context)
Example #31
0
    def draw(self, context):
        """
        Draw final state symbol.
        """
        cr = context.cairo
        r = self.RADIUS_2 + 1
        d = self.RADIUS_1 * 2
        path_ellipse(cr, r, r, d, d)
        cr.set_line_width(0.01)
        cr.fill()

        d = r * 2
        path_ellipse(cr, r, r, d, d)
        cr.set_line_width(0.01)
        cr.set_line_width(2)
        cr.stroke()

        super(FinalStateItem, self).draw(context)
Example #32
0
def draw_activity_final_node(_box, context, _bounding_box):
    cr = context.cairo
    stroke_color = context.style["color"]
    if stroke_color:
        cr.set_source_rgba(*stroke_color)

    inner_radius = 10
    outer_radius = 15
    r = outer_radius + 1

    d = r * 2
    path_ellipse(cr, r, r, d, d)
    cr.set_line_width(0.01)
    cr.set_line_width(2)
    stroke(context)

    d = inner_radius * 2
    path_ellipse(cr, r, r, d, d)
    cr.set_line_width(0.01)
    cr.fill()
Example #33
0
 def draw(self, context):
     cr = context.cairo
     path_ellipse(cr, 0, 0, 2 * self.radius, 2 * self.radius)
     cr.stroke()