def __init__(self, label, icon, parent=None):
        gui.Button.__init__(self, parent)
        ofDisableDataPath()
        self.font = fontmanager.manager.getFont("Frutiger-Roman.ttf",9)
#        print "loaded",self.font
        self.label = label
        self.tooltip = node_descriptions.get(self.label)
        self.icon = ofImage()
        if not self.icon.loadImage(icon):
            print "Failed to load",icon
        
        self.nodeToCreate = nodepallet.getNodeFromLabel(label)
        self.downCallback = self.handlePress
 def pasteSelectedNodes(self):
     if self.nodesToCopy:
         gui.manager.selectionManager.deselectAll()
         for o in self.nodesToCopy:
             nodeClass = nodepallet.getNodeFromLabel(o.label)
             newNode = nodeClass()
             newNode.copyAttributes(o)
             x,y = o.getPosition()
             newNode.setPosition(x + 43, y + 43)
             gui.manager.selectionManager.select(newNode)
             newNode.mouseState = gui.MouseTweaker.MOUSE_DRAGGING_US
     else:
         print "there is nothing in the ARIEL clipboard to paste!"
Exemplo n.º 3
0
    def __init__(self, label, icon, parent=None):
        gui.Button.__init__(self, parent)
        ofDisableDataPath()
        self.font = fontmanager.manager.getFont("Frutiger-Roman.ttf", 9)
        #        print "loaded",self.font
        self.label = label
        self.tooltip = node_descriptions.get(self.label)
        self.icon = ofImage()
        if not self.icon.loadImage(icon):
            print "Failed to load", icon

        self.nodeToCreate = nodepallet.getNodeFromLabel(label)
        self.downCallback = self.handlePress
Exemplo n.º 4
0
 def pasteSelectedNodes(self):
     if self.nodesToCopy:
         gui.manager.selectionManager.deselectAll()
         for o in self.nodesToCopy:
             nodeClass = nodepallet.getNodeFromLabel(o.label)
             newNode = nodeClass()
             newNode.copyAttributes(o)
             x, y = o.getPosition()
             newNode.setPosition(x + 43, y + 43)
             gui.manager.selectionManager.select(newNode)
             newNode.mouseState = gui.MouseTweaker.MOUSE_DRAGGING_US
     else:
         print "there is nothing in the ARIEL clipboard to paste!"
 def duplicateViaOptionDrag(self):
     # copy the selection into temp list
     # deselect
     # do copy/paste routine
     copyList = []
     for o in gui.manager.selectionManager.selectedObjects:
         copyList.append(o)
         o.mouseState = gui.MouseTweaker.MOUSE_DRAGGING_ELSEWHERE
     gui.manager.selectionManager.deselectAll()
     for o in copyList:
         nodeClass = nodepallet.getNodeFromLabel(o.label)
         newNode = nodeClass()
         newNode.copyAttributes(o)
         x,y = o.getPosition()
         newNode.setPosition(x,y)
         gui.manager.selectionManager.select(newNode)
         newNode.mouseState = gui.MouseTweaker.MOUSE_DRAGGING_US
Exemplo n.º 6
0
 def duplicateViaOptionDrag(self):
     # copy the selection into temp list
     # deselect
     # do copy/paste routine
     copyList = []
     for o in gui.manager.selectionManager.selectedObjects:
         copyList.append(o)
         o.mouseState = gui.MouseTweaker.MOUSE_DRAGGING_ELSEWHERE
     gui.manager.selectionManager.deselectAll()
     for o in copyList:
         nodeClass = nodepallet.getNodeFromLabel(o.label)
         newNode = nodeClass()
         newNode.copyAttributes(o)
         x, y = o.getPosition()
         newNode.setPosition(x, y)
         gui.manager.selectionManager.select(newNode)
         newNode.mouseState = gui.MouseTweaker.MOUSE_DRAGGING_US