예제 #1
0
    def __init__(self, x=0.0, y=0.0, **kwargs):
        self.radius = process_radius(0.05, kwargs)
        self.line_width = process_line_width(1.5, kwargs)
        self.face_color = process_face_color((1.0, 1.0, 1.0), kwargs)
        self.alpha = process_alpha(1.0, kwargs)
        self.edge_color = process_edge_color((0.0, 0.0, 0.0), kwargs)

        Label.__init__(self, Point(x, y), **kwargs)
        super(Node, self).__init__(x, y)

        self.draw_bool = process_draw(True, kwargs)
        self.draw_label_bool = process_draw_label(True, kwargs)

        self._instances[id(self)] = self
예제 #2
0
파일: node.py 프로젝트: andrsd/schematics
  def __init__(self, x = 0.0, y = 0.0, **kwargs):
    self.radius = process_radius(0.05, kwargs)
    self.line_width = process_line_width(1.5, kwargs)
    self.face_color = process_face_color((1.0, 1.0, 1.0), kwargs)
    self.alpha = process_alpha(1.0, kwargs)
    self.edge_color = process_edge_color((0.0, 0.0, 0.0), kwargs)


    Label.__init__(self, Point(x, y), **kwargs)
    super(Node, self).__init__(x, y)

    self.draw_bool = process_draw(True, kwargs)
    self.draw_label_bool = process_draw_label(True, kwargs)

    self._instances[id(self)] = self
예제 #3
0
파일: node.py 프로젝트: andrsd/schematics
  def draw(self, **kwargs):
    self.radius = process_radius(self.radius, kwargs)
    self.line_width = process_line_width(self.line_width, kwargs)
    self.face_color = process_face_color(self.face_color, kwargs)
    self.alpha = process_alpha(self.alpha, kwargs)
    self.edge_color = process_edge_color(self.edge_color, kwargs)

    if self.draw_bool:
      patch = Circle((self.x, self.y), radius = self.radius,
                     fc = self.face_color, alpha = self.alpha,
                     ec = self.edge_color, lw = self.line_width
                    )
      return patch

    else:
      self.radius = 0.0
      return None
예제 #4
0
    def draw(self, **kwargs):
        self.radius = process_radius(self.radius, kwargs)
        self.line_width = process_line_width(self.line_width, kwargs)
        self.face_color = process_face_color(self.face_color, kwargs)
        self.alpha = process_alpha(self.alpha, kwargs)
        self.edge_color = process_edge_color(self.edge_color, kwargs)

        if self.draw_bool:
            patch = Circle((self.x, self.y),
                           radius=self.radius,
                           fc=self.face_color,
                           alpha=self.alpha,
                           ec=self.edge_color,
                           lw=self.line_width)
            return patch

        else:
            self.radius = 0.0
            return None
예제 #5
0
    def __init__(self, center_of_rotation, **kwargs):
        Component.stats[self.__class__.__name__] += 1

        super(Component, self).__init__(center_of_rotation, **kwargs)
        Transformation.__init__(self, center_of_rotation, **kwargs)

        self.name = process_name(None, kwargs)
        self.label_string = self.name

        self.graph = Graph(name=self.name)
        self._get_nodes()
        self._connect_nodes()

        self.face_color = process_face_color((1.0, 1.0, 1.0), kwargs)
        self.edge_color = process_edge_color((0.0, 0.0, 0.0), kwargs)
        self.line_width = process_line_width(1.5, kwargs)
        self.patch = None

        self._points = []
        self._connections = []
예제 #6
0
  def __init__(self, center_of_rotation, **kwargs):
    Component.stats[self.__class__.__name__] += 1

    super(Component, self).__init__(center_of_rotation, **kwargs)
    Transformation.__init__(self, center_of_rotation, **kwargs)

    self.name = process_name(None, kwargs)
    self.label_string = self.name

    self.graph = Graph(name = self.name)
    self._get_nodes()
    self._connect_nodes()

    self.face_color = process_face_color((1.0, 1.0, 1.0), kwargs)
    self.edge_color = process_edge_color((0.0, 0.0, 0.0), kwargs)
    self.line_width = process_line_width(1.5, kwargs)
    self.patch = None

    self._points = []
    self._connections = []