Beispiel #1
0
    def __init__(self,parent,index=None,dx=0.05,dy=0.05,
                 placement="iur",label_scheme=None,
                 *args,**kwargs):
        DrawText.__init__(self,parent,*args,**kwargs)

        # add panel keyword arguments to local name space.  This
        # allows you to (i) say things like "graph.panel_label.dx=0.1"
        # and (ii) use copy format to copy the attribute values of the
        # panel label.
        self._set_kwargs_attributes(locals())

        # panel label always lives in view coordinates to prevent it
        # from being marked as out of bounds in the event that
        # Graph.remove_extraworld_drawing_objects is called.
        if self.loctype!="view":
            message = """
PanelLabel always lives in 'view' coordinates to prevent it from being
marked as out of bounds in the event that
Graph.remove_extraworld_drawing_objects is called.
"""
            raise TypeError, message

        # specify formats for panel labels
        self.set_text()

        # place the panel label.  This method is also called at draw
        # time in the event that a user changes the location of the
        # PanelLabel
        #
        # Checking for None, which is necessary for copy_format to work.
        if self.parent is not None: 
            self.place_label()
Beispiel #2
0
 def __str__(self):
     """Override the __str__ functionality to draw the PanelLabel at
     draw time.
     """
     self.set_text()
     self.place_label()
     return DrawText.__str__(self)
Beispiel #3
0
 def __str__(self):
     """Override the __str__ functionality to draw the PanelLabel at
     draw time.
     """
     self.set_text()
     self.place_label()
     return DrawText.__str__(self)
Beispiel #4
0
    def __init__(self,
                 parent,
                 index=None,
                 dx=0.05,
                 dy=0.05,
                 placement="iur",
                 label_scheme=None,
                 *args,
                 **kwargs):
        DrawText.__init__(self, parent, *args, **kwargs)

        # add panel keyword arguments to local name space.  This
        # allows you to (i) say things like "graph.panel_label.dx=0.1"
        # and (ii) use copy format to copy the attribute values of the
        # panel label.
        self._set_kwargs_attributes(locals())

        # panel label always lives in view coordinates to prevent it
        # from being marked as out of bounds in the event that
        # Graph.remove_extraworld_drawing_objects is called.
        if self.loctype != "view":
            message = """
PanelLabel always lives in 'view' coordinates to prevent it from being
marked as out of bounds in the event that
Graph.remove_extraworld_drawing_objects is called.
"""
            raise TypeError, message

        # specify formats for panel labels
        self.set_text()

        # place the panel label.  This method is also called at draw
        # time in the event that a user changes the location of the
        # PanelLabel
        #
        # Checking for None, which is necessary for copy_format to work.
        if self.parent is not None:
            self.place_label()