Пример #1
0
 def __init__(self, width, height, blocksize, fullscreen=False):
     Interface.__init__(self, width, height, blocksize)
     self.flags = pygame.DOUBLEBUF | pygame.HWSURFACE
     if fullscreen:
         self.flags |= pygame.FULLSCREEN
     self.window = pygame.display.set_mode((self.width, self.height),
                                           self.flags)
Пример #2
0
 def __init__(self, game_instance):
     Interface.__init__(self, game_instance)
     PygameHelper.__init__(self)
     self.first_selected_square = None
     self.second_selected_square = None
     self.current_move = None
     
     self.squares = []
     self.region_to_coord = {}
     self.coord_to_region = {}
     self.sprites = {}
     
     self.white_square_color = (247, 196, 145)
     self.black_square_color = (188, 123, 64)
     
     self.game = game_instance
     self.setup()
Пример #3
0
    def __init__(self, width, height, pixelsize, fullscreen):
        Interface.__init__(self, width, height, pixelsize)
        glutInit()
        glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH)
        glutInitWindowSize(self.width, self.height)
        glutInitWindowPosition(self.width, self.height)
        self.window = glutCreateWindow("matrix Sim")
        glutKeyboardFunc(self.keyboardinput)
        if fullscreen:
            glutFullScreen()
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
        glLoadIdentity()
        glViewport(0, 0, self.width, self.height)
        glMatrixMode(GL_PROJECTION)
        glLoadIdentity()
        glOrtho(0.0, self.width, 0.0, self.height, 0.0, 1.0)
        glMatrixMode(GL_MODELVIEW)
        glLoadIdentity()

        glutMainLoopEvent()
Пример #4
0
 def __init__(self, x_pos, y_pos, width, height, topbar, ID):
     Interface.__init__(self, x_pos, y_pos, width, height, topbar, ID,
                        "Inventory")
     self.inventorySpots = []
     for x in range(10):
         self.inventorySpots.append(InventorySpot())
Пример #5
0
 def __init__(self):
     Interface.__init__(self)
Пример #6
0
 def __init__(self):
     Interface.__init__(self)
     self.A,self.C,self.G,self.T=0.25,0.25,0.25,0.25
     
     # This is a map from commands to their functions and
     # at least required number of arguments
     self.__commands={'about':              (self.about,0),
                      'h':                  (self.help,0),
                      'help':               (self.help,0),
                      '?':                  (self.help,0),
                      'addMatrix':          (self.addMatrix,1),
                      'am':                 (self.addMatrix,1),
                      'removeMatrix':       (self.removeMatrix,1),
                      'rm':                 (self.removeMatrix,1),
                      'align':              (self.align,0),
                      'resetMatrices':      (self.resetMatrices,0),
                      'resm':               (self.resetMatrices,0),
                      'printMatrices':      (self.printMatrices,0),
                      'pm':                 (self.printMatrices,0),
                      'pmw':                (self.printMatrixWeights,0),
                      'printMatrixWeights': (self.printMatrixWeights,0),
                      'addSequence':        (self.addSequence,1),
                      'as':                 (self.addSequence,1), 
                      'removeSequence':     (self.removeSequence,1),
                      'rs':                 (self.removeSequence,1),
                      'resetSequences':     (self.resetSequences,0),
                      'ress':               (self.resetSequences,0),
                      'reset':              (self.reset,0),
                      "setBGfreq":          (self.setBGFreq,1),
                      "setMarkovBG":        (self._setMarkovBG,1),
                      'printSeqNames':      (self.printSeqNames,0),
                      'ps':                 (self.printSeqNames,0),
                      'getTFBS':            (self.getTFBS,0),
                      'getTFBSabsolute':    (self.getTFBSabsolute,0),
                      'getTFBSpvalue':    (self.getTFBSpvalue,0),
                      'showmatch':          (self.showmatch,0),
                      'sm':                 (self.showmatch,0),
                      'q':                  (self.quit,0),
                      'quit':               (self.quit,0),
                      'savematch':          (self.savematch,0),
                      'savealign':          (self.savealign,0),
                      'savealignGFF':       (self.savealignGFF,0),
                      'savealignAnchor':       (self.savealignAnchor,0),
                      'showpwbase':          (self.showpwbase,0),
                      'savepwbase':          (self.savepwbase,0),
                      'showalign':          (self.showalign,0),
                      'sa':                 (self.showalign,0),
                      'setpseudocount':     (self.setPseudoCnt,1),
                      'addSingleSequence':      (self.addSingleSequence,1),
                      'ass':               (self.addSingleSequence,1),
                      'saveMarkovBackground':  (self.saveMarkovBackground,1),
                      'more':               (self.moreAlignment,0),
                      'suboptimals':               (self.suboptimalAlignment,0),
                      'suboptimalsDownTo':               (self.suboptimalAlignmentsDownTo,1),
                      '__multipleAlignGreedy':      (self.multiAlignGreedy,1),
                      'shortMultipleAlign':      (self.shortMultiAlign,1),
                      'multiFromPairwise':      (self.multiFromPairwise,2),
                      'treeMultipleAlign':      (self.treeMultiAlign,2),
                      'nodeAlignments':      (self.nodeAlignments,1),
                      'multipleAlign':      (self.multiAlign,0),
                      '__showMultiAlign':     (self.showMultiAlign,0),
                      '__saveMultiAlign':     (self.saveMultiAlign,1),
                      'no-gui':               (self.no_gui,0),
                      'computeKLdistances': (self.showKLdist,1),
                      '__computeEscores': (self.showExpectedScores,1),
                      '__head': (self.getHead,1),
                      '__randomize_full': (self.randomize_full,0)
                      }
     # Add directory commands if available.
     if globals().has_key("os") and hasattr(os,"getcwd") and hasattr(os,"chdir"):
         self.__commands.update({'dir':                  (self.dirlist,0),
                                 'cd':                   (self.chgdir,0)})
Пример #7
0
 def __init__(self):
     Interface.__init__(self)
     self.mainloop()
Пример #8
0
 def __init__(self, width, height, blocksize, fullscreen=False):
     Interface.__init__(self, width, height, blocksize, fullscreen)
Пример #9
0
 def __init__(self, session):
     self.sessionLogin = session
     Interface.__init__(self)
Пример #10
0
 def __init__(self):
     Interface.__init__(self)
     self.proxy = ('127.0.0.1', 8087)
Пример #11
0
 def __init__(self, x_pos, y_pos, width, height, topbar, ID):
     Interface.__init__(self, x_pos, y_pos, width, height, topbar, ID,
                        "Skilltree")
     self.panel = Skilltreepanel(20, 20)
Пример #12
0
	def __init__(self):
		Interface.__init__(self)
		self.addContenuAccueilJoueur()
		self.addContenuAccueilAdmin()
Пример #13
0
 def __init__(self):
     Interface.__init__(self)
     self.proxy = ('127.0.0.1', 8087)