示例#1
0
 def __init__ (self, **attr):
     Element.__init__ (self, name='path', **attr)
     if attr.has_key ('data'):
         self.data = attr['data']
     else:
         self.data = None
     if attr.has_key ('transform'):
         self.postTransform = attr['transform']
     else:
         self.postTransform = None
示例#2
0
 def __init__(self, **attr):
     Element.__init__(self, name='path', **attr)
     if attr.has_key('data'):
         self.data = attr['data']
     else:
         self.data = None
     if attr.has_key('transform'):
         self.postTransform = attr['transform']
     else:
         self.postTransform = None
示例#3
0
 def setSVG (self):
     attr = Element.setSVG (self)
     elements = deepcopy (self.elements)
     self.applyTransform (*elements)
     strings = map (str, elements)
     if self.closed:
         strings.append (str (CloseElement ()))
     attr.update ([('d', ' '.join (strings)), ('transform', self.postTransform)])
     return attr
示例#4
0
 def setSVG(self):
     attr = Element.setSVG(self)
     elements = deepcopy(self.elements)
     self.applyTransform(*elements)
     strings = map(str, elements)
     if self.closed:
         strings.append(str(CloseElement()))
     attr.update([('d', ' '.join(strings)),
                  ('transform', self.postTransform)])
     return attr
示例#5
0
 def SVG(self, indent):
     attr = self.setSVG()
     nextIndent = indent + '    '
     if len(self) > 0:
         output = indent + '<' + self.name
         attributes = attributesToSVG(attr)
         if attributes != '':
             output += ' ' + attributes
         output += '>\n'
         output += self.childrenSVG(nextIndent)
         output += indent + '</' + self.name + '>\n'
     else:
         output = Element.SVG(self, indent)
     return output
示例#6
0
 def onCursorLose(self, cursor):
     Element.onCursorLose(self, cursor)
     if not self.released:
         self.pressed = False
示例#7
0
 def onCursorGain(self, cursor):
     Element.onCursorGain(self, cursor)
     if not self.released:
         self.pressed = True
示例#8
0
 def __init__(self, *args, **kwargs):
     Element.__init__(self, *args, **kwargs)
     self._pressed = False
     self.released = True
示例#9
0
 def onButtonDown(self, cursor, button):
     Element.onButtonDown(self, cursor, button)
     if button == cursor.buttonPrimary:
         self.onState()
示例#10
0
 def __init__(self, states, *args, **kwargs):
     Element.__init__(self, *args, **kwargs)
     self.command = doNothing
     self.states = cycle(states)
     self.onState()
示例#11
0
 def __init__(self, **attr):
     Element.__init__(self, **attr)
     self.transform = identity(3)
     self.children = []
     """if hasattr (self, 'x'):
示例#12
0
 def __init__(self, text='', **kwargs):
     Element.__init__(self)
     self.kwargs = kwargs
     self.set_text(text)
示例#13
0
 def setSVG(self):
     attr = Element.setSVG(self)
     attr.update([('d', self.data), ('transform', self.postTransform)])
     return attr
示例#14
0
 def setSVG (self):
     attr = Element.setSVG (self)
     attr.update ([('d', self.data), ('transform', self.postTransform)])
     return attr
示例#15
0
文件: group.py 项目: Akanksha18/eden
 def __init__ (self, **attr):
     Element.__init__ (self, **attr)
     self.transform = identity (3)
     self.children = []
     """if hasattr (self, 'x'):
示例#16
0
 def onButtonDown(self, cursor, button):
     Element.onButtonDown(self, cursor, button)
     if button == cursor.buttonPrimary:
         self.pressed = True
         self.released = False
示例#17
0
 def onButtonUp(self, cursor, button):
     Element.onButtonUp(self, cursor, button)
     if (button == cursor.buttonPrimary):
         self.released = True
         if self.pressed:
             self.pressed = False
示例#18
0
 def __init__ (self, **attr):
     Element.__init__ (self, **attr)
     self.children = []
     self.transform = identity (3)