コード例 #1
0
ファイル: imagej2.py プロジェクト: fsun2p10/CellProfiler
 def getModules(self):
     modules = J.call(o, "getModules", "()Ljava/util/List;")
     if modules is None:
         return []
     module_iterator = J.call(modules, "iterator", 
                              "()Ljava/util/Iterator;")
     return [wrap_module_info(x) for x in J.iterate_java(module_iterator)]
コード例 #2
0
ファイル: imagej2.py プロジェクト: erexhepa/CellProfiler
 def getModules(self):
     modules = J.call(o, "getModules", "()Ljava/util/List;")
     if modules is None:
         return []
     module_iterator = J.call(modules, "iterator", 
                              "()Ljava/util/Iterator;")
     return [wrap_module_info(x) for x in J.iterate_java(module_iterator)]
コード例 #3
0
ファイル: macros.py プロジェクト: erexhepa/CellProfiler
def get_commands():
    '''Return a list of the available command strings'''
    hashtable = J.static_call('ij/Menus', 'getCommands',
                              '()Ljava/util/Hashtable;')
    if hashtable is None:
        #
        # This is a little bogus, but works - trick IJ into initializing
        #
        execute_command("pleaseignorethis")
        hashtable = J.static_call('ij/Menus', 'getCommands',
                                  '()Ljava/util/Hashtable;')
        if hashtable is None:
            return []
    keys = J.call(hashtable, "keys", "()Ljava/util/Enumeration;")
    keys = J.jenumeration_to_string_list(keys)
    values = J.call(hashtable, "values", "()Ljava/util/Collection;")
    values = [
        J.to_string(x) for x in J.iterate_java(
            J.call(values, 'iterator', "()Ljava/util/Iterator;"))
    ]

    class CommandList(list):
        def __init__(self):
            super(CommandList, self).__init__(keys)
            self.values = values

    return CommandList()
コード例 #4
0
ファイル: macros.py プロジェクト: AnneCarpenter/CellProfiler
def get_commands():
    """Return a list of the available command strings"""
    hashtable = J.static_call('ij/Menus', 'getCommands',
                              '()Ljava/util/Hashtable;')
    if hashtable is None:
        #
        # This is a little bogus, but works - trick IJ into initializing
        #
        execute_command("pleaseignorethis")
        hashtable = J.static_call('ij/Menus', 'getCommands',
                                  '()Ljava/util/Hashtable;')
        if hashtable is None:
            return []
    keys = J.call(hashtable, "keys", "()Ljava/util/Enumeration;")
    keys = J.jenumeration_to_string_list(keys)
    values = J.call(hashtable, "values", "()Ljava/util/Collection;")
    values = [J.to_string(x) for x in J.iterate_java(
            J.call(values, 'iterator', "()Ljava/util/Iterator;"))]

    class CommandList(list):
        def __init__(self):
            super(CommandList, self).__init__(keys)
            self.values = values

    return CommandList()
コード例 #5
0
 def dependencies(self):
     """
     Returns all the dependencies.
     :return: the dependency list
     :rtype: list
     """
     result = []
     iterator = javabridge.iterate_java(javabridge.call(self.jobject, "dependencies", "()Ljava/util/Iterator;"))
     for c in iterator:
         result.append(Capability(c))
     return result
コード例 #6
0
 def dependencies(self):
     """
     Returns all the dependencies.
     :return: the dependency list
     :rtype: list
     """
     result = []
     iterator = javabridge.iterate_java(javabridge.call(self.jobject, "dependencies", "()Ljava/util/Iterator;"))
     for c in iterator:
         result.append(Capability(c))
     return result
コード例 #7
0
 def fn():
     list(javabridge.iterate_java(javabridge.make_list(range(10)).o))
コード例 #8
0
 def fn():
     list(javabridge.iterate_java(javabridge.make_list(range(10)).o))