'Add a new node to our canvas.'

def newNode(self, node, event):

    c = self.canvas
    (x, y) = (c.canvasx(event.x), c.canvasy(event.y))
    name = self.nodePrefixes[node]
    if ('Switch' == node):
        self.switchCount += 1
        name = (self.nodePrefixes[node] + str(self.switchCount))
        self.switchOpts[name] = {}
        self.switchOpts[name]['nodeNum'] = self.switchCount
        self.switchOpts[name]['hostname'] = name
        self.switchOpts[name]['switchType'] = 'default'
        self.switchOpts[name]['controllers'] = []
    if ('LegacyRouter' == node):
        self.switchCount += 1
        name = (self.nodePrefixes[node] + str(self.switchCount))
        self.switchOpts[name] = {}
        self.switchOpts[name]['nodeNum'] = self.switchCount
        self.switchOpts[name]['hostname'] = name
        self.switchOpts[name]['switchType'] = 'legacyRouter'
    if ('LegacySwitch' == node):
        self.switchCount += 1
        name = (self.nodePrefixes[node] + str(self.switchCount))
        self.switchOpts[name] = {}
        self.switchOpts[name]['nodeNum'] = self.switchCount
        self.switchOpts[name]['hostname'] = name
        self.switchOpts[name]['switchType'] = 'legacySwitch'
        self.switchOpts[name]['controllers'] = []
    if ('Host' == node):
        self.hostCount += 1
        name = (self.nodePrefixes[node] + str(self.hostCount))
        self.hostOpts[name] = {'sched': 'host'}
        self.hostOpts[name]['nodeNum'] = self.hostCount
        self.hostOpts[name]['hostname'] = name
    if ('Controller' == node):
        name = (self.nodePrefixes[node] + str(self.controllerCount))
        ctrlr = {'controllerType': 'ref', 'hostname': name, 'controllerProtocol': 'tcp', 'remoteIP': '127.0.0.1', 'remotePort': 6633}
        self.controllers[name] = ctrlr
        self.controllerCount += 1
    icon = self.nodeIcon(node, name)
    item = self.canvas.create_window(x, y, anchor='c', window=icon, tags=node)
    self.widgetToItem[icon] = item
    self.itemToWidget[item] = icon
    self.selectItem(item)
    icon.links = {}
    if ('Switch' == node):
        icon.bind('<Button-3>', self.do_switchPopup)
    if ('LegacyRouter' == node):
        icon.bind('<Button-3>', self.do_legacyRouterPopup)
    if ('LegacySwitch' == node):
        icon.bind('<Button-3>', self.do_legacySwitchPopup)
    if ('Host' == node):
        icon.bind('<Button-3>', self.do_hostPopup)
    if ('Controller' == node):
        icon.bind('<Button-3>', self.do_controllerPopup)
