当前位置: 首页>>代码示例>>Java>>正文


Java JRubyAdapter.isJRubyOneSeven方法代码示例

本文整理汇总了Java中org.ruboto.JRubyAdapter.isJRubyOneSeven方法的典型用法代码示例。如果您正苦于以下问题:Java JRubyAdapter.isJRubyOneSeven方法的具体用法?Java JRubyAdapter.isJRubyOneSeven怎么用?Java JRubyAdapter.isJRubyOneSeven使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.ruboto.JRubyAdapter的用法示例。


在下文中一共展示了JRubyAdapter.isJRubyOneSeven方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onAnimationEnd

import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public void onAnimationEnd() {
  if (ScriptLoader.isCalledFromJRuby()) {super.onAnimationEnd(); return;}
  if (!JRubyAdapter.isInitialized()) {
    Log.i("Method called before JRuby runtime was initialized: GraphicsView#onAnimationEnd");
    {super.onAnimationEnd(); return;}
  }
  String rubyClassName = scriptInfo.getRubyClassName();
  if (rubyClassName == null) {super.onAnimationEnd(); return;}
  if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_animation_end}")) {
    // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
    if (JRubyAdapter.isJRubyPreOneSeven()) {
      JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
      JRubyAdapter.runScriptlet("$ruby_instance.on_animation_end()");
    } else {
      if (JRubyAdapter.isJRubyOneSeven()) {
        JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "on_animation_end");
      } else {
        throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
      }
    }
  } else {
    if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onAnimationEnd}")) {
      // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
      if (JRubyAdapter.isJRubyPreOneSeven()) {
        JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
        JRubyAdapter.runScriptlet("$ruby_instance.onAnimationEnd()");
      } else {
        if (JRubyAdapter.isJRubyOneSeven()) {
          JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "onAnimationEnd");
        } else {
          throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
        }
      }
    } else {
      {super.onAnimationEnd(); return;}
    }
  }
}
 
开发者ID:Nitrino,项目名称:ruboto_audio,代码行数:39,代码来源:GraphicsView.java

示例2: onWindowVisibilityChanged

import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public void onWindowVisibilityChanged(int visibility) {
  if (ScriptLoader.isCalledFromJRuby()) {super.onWindowVisibilityChanged(visibility); return;}
  if (!JRubyAdapter.isInitialized()) {
    Log.i("Method called before JRuby runtime was initialized: GraphicsView#onWindowVisibilityChanged");
    {super.onWindowVisibilityChanged(visibility); return;}
  }
  String rubyClassName = scriptInfo.getRubyClassName();
  if (rubyClassName == null) {super.onWindowVisibilityChanged(visibility); return;}
  if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_window_visibility_changed}")) {
    // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
    if (JRubyAdapter.isJRubyPreOneSeven()) {
      JRubyAdapter.put("$arg_visibility", visibility);
      JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
      JRubyAdapter.runScriptlet("$ruby_instance.on_window_visibility_changed($arg_visibility)");
    } else {
      if (JRubyAdapter.isJRubyOneSeven()) {
        JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "on_window_visibility_changed", visibility);
      } else {
        throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
      }
    }
  } else {
    if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onWindowVisibilityChanged}")) {
      // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
      if (JRubyAdapter.isJRubyPreOneSeven()) {
        JRubyAdapter.put("$arg_visibility", visibility);
        JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
        JRubyAdapter.runScriptlet("$ruby_instance.onWindowVisibilityChanged($arg_visibility)");
      } else {
        if (JRubyAdapter.isJRubyOneSeven()) {
          JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "onWindowVisibilityChanged", visibility);
        } else {
          throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
        }
      }
    } else {
      {super.onWindowVisibilityChanged(visibility); return;}
    }
  }
}
 
开发者ID:Nitrino,项目名称:ruboto_audio,代码行数:41,代码来源:GraphicsView.java

示例3: onCreateContextMenu

import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public void onCreateContextMenu(android.view.ContextMenu menu) {
  if (ScriptLoader.isCalledFromJRuby()) {super.onCreateContextMenu(menu); return;}
  if (!JRubyAdapter.isInitialized()) {
    Log.i("Method called before JRuby runtime was initialized: GraphicsView#onCreateContextMenu");
    {super.onCreateContextMenu(menu); return;}
  }
  String rubyClassName = scriptInfo.getRubyClassName();
  if (rubyClassName == null) {super.onCreateContextMenu(menu); return;}
  if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_create_context_menu}")) {
    // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
    if (JRubyAdapter.isJRubyPreOneSeven()) {
      JRubyAdapter.put("$arg_menu", menu);
      JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
      JRubyAdapter.runScriptlet("$ruby_instance.on_create_context_menu($arg_menu)");
    } else {
      if (JRubyAdapter.isJRubyOneSeven()) {
        JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "on_create_context_menu", menu);
      } else {
        throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
      }
    }
  } else {
    if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onCreateContextMenu}")) {
      // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
      if (JRubyAdapter.isJRubyPreOneSeven()) {
        JRubyAdapter.put("$arg_menu", menu);
        JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
        JRubyAdapter.runScriptlet("$ruby_instance.onCreateContextMenu($arg_menu)");
      } else {
        if (JRubyAdapter.isJRubyOneSeven()) {
          JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "onCreateContextMenu", menu);
        } else {
          throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
        }
      }
    } else {
      {super.onCreateContextMenu(menu); return;}
    }
  }
}
 
开发者ID:Nitrino,项目名称:ruboto_audio,代码行数:41,代码来源:GraphicsView.java

示例4: onCreateDrawableState

import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public int[] onCreateDrawableState(int extraSpace) {
  if (ScriptLoader.isCalledFromJRuby()) return super.onCreateDrawableState(extraSpace);
  if (!JRubyAdapter.isInitialized()) {
    Log.i("Method called before JRuby runtime was initialized: GraphicsView#onCreateDrawableState");
    return super.onCreateDrawableState(extraSpace);
  }
  String rubyClassName = scriptInfo.getRubyClassName();
  if (rubyClassName == null) return super.onCreateDrawableState(extraSpace);
  if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_create_drawable_state}")) {
    // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
    if (JRubyAdapter.isJRubyPreOneSeven()) {
      JRubyAdapter.put("$arg_extraSpace", extraSpace);
      JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
      return (int[]) JRubyAdapter.runScriptlet("$ruby_instance.on_create_drawable_state($arg_extraSpace)");
    } else {
      if (JRubyAdapter.isJRubyOneSeven()) {
        return (int[]) JRubyAdapter.runRubyMethod(int[].class, scriptInfo.getRubyInstance(), "on_create_drawable_state", extraSpace);
      } else {
        throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
      }
    }
  } else {
    if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onCreateDrawableState}")) {
      // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
      if (JRubyAdapter.isJRubyPreOneSeven()) {
        JRubyAdapter.put("$arg_extraSpace", extraSpace);
        JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
        return (int[]) JRubyAdapter.runScriptlet("$ruby_instance.onCreateDrawableState($arg_extraSpace)");
      } else {
        if (JRubyAdapter.isJRubyOneSeven()) {
          return (int[]) JRubyAdapter.runRubyMethod(int[].class, scriptInfo.getRubyInstance(), "onCreateDrawableState", extraSpace);
        } else {
          throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
        }
      }
    } else {
      return super.onCreateDrawableState(extraSpace);
    }
  }
}
 
开发者ID:Nitrino,项目名称:ruboto_audio,代码行数:41,代码来源:GraphicsView.java

示例5: onCheckIsTextEditor

import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public boolean onCheckIsTextEditor() {
  if (ScriptLoader.isCalledFromJRuby()) return super.onCheckIsTextEditor();
  if (!JRubyAdapter.isInitialized()) {
    Log.i("Method called before JRuby runtime was initialized: GraphicsView#onCheckIsTextEditor");
    return super.onCheckIsTextEditor();
  }
  String rubyClassName = scriptInfo.getRubyClassName();
  if (rubyClassName == null) return super.onCheckIsTextEditor();
  if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_check_is_text_editor}")) {
    // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
    if (JRubyAdapter.isJRubyPreOneSeven()) {
      JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
      return (Boolean) JRubyAdapter.runScriptlet("$ruby_instance.on_check_is_text_editor()");
    } else {
      if (JRubyAdapter.isJRubyOneSeven()) {
        return (Boolean) JRubyAdapter.runRubyMethod(Boolean.class, scriptInfo.getRubyInstance(), "on_check_is_text_editor");
      } else {
        throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
      }
    }
  } else {
    if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onCheckIsTextEditor}")) {
      // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
      if (JRubyAdapter.isJRubyPreOneSeven()) {
        JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
        return (Boolean) JRubyAdapter.runScriptlet("$ruby_instance.onCheckIsTextEditor()");
      } else {
        if (JRubyAdapter.isJRubyOneSeven()) {
          return (Boolean) JRubyAdapter.runRubyMethod(Boolean.class, scriptInfo.getRubyInstance(), "onCheckIsTextEditor");
        } else {
          throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
        }
      }
    } else {
      return super.onCheckIsTextEditor();
    }
  }
}
 
开发者ID:Nitrino,项目名称:ruboto_audio,代码行数:39,代码来源:GraphicsView.java

示例6: onDraw

import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public void onDraw(android.graphics.Canvas canvas) {
  if (ScriptLoader.isCalledFromJRuby()) {super.onDraw(canvas); return;}
  if (!JRubyAdapter.isInitialized()) {
    Log.i("Method called before JRuby runtime was initialized: GraphicsView#onDraw");
    {super.onDraw(canvas); return;}
  }
  String rubyClassName = scriptInfo.getRubyClassName();
  if (rubyClassName == null) {super.onDraw(canvas); return;}
  if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_draw}")) {
    // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
    if (JRubyAdapter.isJRubyPreOneSeven()) {
      JRubyAdapter.put("$arg_canvas", canvas);
      JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
      JRubyAdapter.runScriptlet("$ruby_instance.on_draw($arg_canvas)");
    } else {
      if (JRubyAdapter.isJRubyOneSeven()) {
        JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "on_draw", canvas);
      } else {
        throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
      }
    }
  } else {
    if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onDraw}")) {
      // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
      if (JRubyAdapter.isJRubyPreOneSeven()) {
        JRubyAdapter.put("$arg_canvas", canvas);
        JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
        JRubyAdapter.runScriptlet("$ruby_instance.onDraw($arg_canvas)");
      } else {
        if (JRubyAdapter.isJRubyOneSeven()) {
          JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "onDraw", canvas);
        } else {
          throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
        }
      }
    } else {
      {super.onDraw(canvas); return;}
    }
  }
}
 
开发者ID:Nitrino,项目名称:ruboto_audio,代码行数:41,代码来源:GraphicsView.java

示例7: onConfigurationChanged

import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public void onConfigurationChanged(android.content.res.Configuration newConfig) {
  if (ScriptLoader.isCalledFromJRuby()) {super.onConfigurationChanged(newConfig); return;}
  if (!JRubyAdapter.isInitialized()) {
    Log.i("Method called before JRuby runtime was initialized: GraphicsView#onConfigurationChanged");
    {super.onConfigurationChanged(newConfig); return;}
  }
  String rubyClassName = scriptInfo.getRubyClassName();
  if (rubyClassName == null) {super.onConfigurationChanged(newConfig); return;}
  if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_configuration_changed}")) {
    // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
    if (JRubyAdapter.isJRubyPreOneSeven()) {
      JRubyAdapter.put("$arg_newConfig", newConfig);
      JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
      JRubyAdapter.runScriptlet("$ruby_instance.on_configuration_changed($arg_newConfig)");
    } else {
      if (JRubyAdapter.isJRubyOneSeven()) {
        JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "on_configuration_changed", newConfig);
      } else {
        throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
      }
    }
  } else {
    if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onConfigurationChanged}")) {
      // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
      if (JRubyAdapter.isJRubyPreOneSeven()) {
        JRubyAdapter.put("$arg_newConfig", newConfig);
        JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
        JRubyAdapter.runScriptlet("$ruby_instance.onConfigurationChanged($arg_newConfig)");
      } else {
        if (JRubyAdapter.isJRubyOneSeven()) {
          JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "onConfigurationChanged", newConfig);
        } else {
          throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
        }
      }
    } else {
      {super.onConfigurationChanged(newConfig); return;}
    }
  }
}
 
开发者ID:Nitrino,项目名称:ruboto_audio,代码行数:41,代码来源:GraphicsView.java

示例8: onDisplayHint

import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public void onDisplayHint(int hint) {
  if (ScriptLoader.isCalledFromJRuby()) {super.onDisplayHint(hint); return;}
  if (!JRubyAdapter.isInitialized()) {
    Log.i("Method called before JRuby runtime was initialized: GraphicsView#onDisplayHint");
    {super.onDisplayHint(hint); return;}
  }
  String rubyClassName = scriptInfo.getRubyClassName();
  if (rubyClassName == null) {super.onDisplayHint(hint); return;}
  if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_display_hint}")) {
    // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
    if (JRubyAdapter.isJRubyPreOneSeven()) {
      JRubyAdapter.put("$arg_hint", hint);
      JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
      JRubyAdapter.runScriptlet("$ruby_instance.on_display_hint($arg_hint)");
    } else {
      if (JRubyAdapter.isJRubyOneSeven()) {
        JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "on_display_hint", hint);
      } else {
        throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
      }
    }
  } else {
    if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onDisplayHint}")) {
      // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
      if (JRubyAdapter.isJRubyPreOneSeven()) {
        JRubyAdapter.put("$arg_hint", hint);
        JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
        JRubyAdapter.runScriptlet("$ruby_instance.onDisplayHint($arg_hint)");
      } else {
        if (JRubyAdapter.isJRubyOneSeven()) {
          JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "onDisplayHint", hint);
        } else {
          throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
        }
      }
    } else {
      {super.onDisplayHint(hint); return;}
    }
  }
}
 
开发者ID:Nitrino,项目名称:ruboto_audio,代码行数:41,代码来源:GraphicsView.java

示例9: onFinishTemporaryDetach

import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public void onFinishTemporaryDetach() {
  if (ScriptLoader.isCalledFromJRuby()) {super.onFinishTemporaryDetach(); return;}
  if (!JRubyAdapter.isInitialized()) {
    Log.i("Method called before JRuby runtime was initialized: GraphicsView#onFinishTemporaryDetach");
    {super.onFinishTemporaryDetach(); return;}
  }
  String rubyClassName = scriptInfo.getRubyClassName();
  if (rubyClassName == null) {super.onFinishTemporaryDetach(); return;}
  if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_finish_temporary_detach}")) {
    // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
    if (JRubyAdapter.isJRubyPreOneSeven()) {
      JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
      JRubyAdapter.runScriptlet("$ruby_instance.on_finish_temporary_detach()");
    } else {
      if (JRubyAdapter.isJRubyOneSeven()) {
        JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "on_finish_temporary_detach");
      } else {
        throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
      }
    }
  } else {
    if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onFinishTemporaryDetach}")) {
      // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
      if (JRubyAdapter.isJRubyPreOneSeven()) {
        JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
        JRubyAdapter.runScriptlet("$ruby_instance.onFinishTemporaryDetach()");
      } else {
        if (JRubyAdapter.isJRubyOneSeven()) {
          JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "onFinishTemporaryDetach");
        } else {
          throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
        }
      }
    } else {
      {super.onFinishTemporaryDetach(); return;}
    }
  }
}
 
开发者ID:Nitrino,项目名称:ruboto_audio,代码行数:39,代码来源:GraphicsView.java

示例10: onWindowFocusChanged

import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public void onWindowFocusChanged(boolean hasWindowFocus) {
  if (ScriptLoader.isCalledFromJRuby()) {super.onWindowFocusChanged(hasWindowFocus); return;}
  if (!JRubyAdapter.isInitialized()) {
    Log.i("Method called before JRuby runtime was initialized: GraphicsView#onWindowFocusChanged");
    {super.onWindowFocusChanged(hasWindowFocus); return;}
  }
  String rubyClassName = scriptInfo.getRubyClassName();
  if (rubyClassName == null) {super.onWindowFocusChanged(hasWindowFocus); return;}
  if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_window_focus_changed}")) {
    // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
    if (JRubyAdapter.isJRubyPreOneSeven()) {
      JRubyAdapter.put("$arg_hasWindowFocus", hasWindowFocus);
      JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
      JRubyAdapter.runScriptlet("$ruby_instance.on_window_focus_changed($arg_hasWindowFocus)");
    } else {
      if (JRubyAdapter.isJRubyOneSeven()) {
        JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "on_window_focus_changed", hasWindowFocus);
      } else {
        throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
      }
    }
  } else {
    if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onWindowFocusChanged}")) {
      // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
      if (JRubyAdapter.isJRubyPreOneSeven()) {
        JRubyAdapter.put("$arg_hasWindowFocus", hasWindowFocus);
        JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
        JRubyAdapter.runScriptlet("$ruby_instance.onWindowFocusChanged($arg_hasWindowFocus)");
      } else {
        if (JRubyAdapter.isJRubyOneSeven()) {
          JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "onWindowFocusChanged", hasWindowFocus);
        } else {
          throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
        }
      }
    } else {
      {super.onWindowFocusChanged(hasWindowFocus); return;}
    }
  }
}
 
开发者ID:Nitrino,项目名称:ruboto_audio,代码行数:41,代码来源:GraphicsView.java

示例11: onSaveInstanceState

import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public android.os.Parcelable onSaveInstanceState() {
  if (ScriptLoader.isCalledFromJRuby()) return super.onSaveInstanceState();
  if (!JRubyAdapter.isInitialized()) {
    Log.i("Method called before JRuby runtime was initialized: GraphicsView#onSaveInstanceState");
    return super.onSaveInstanceState();
  }
  String rubyClassName = scriptInfo.getRubyClassName();
  if (rubyClassName == null) return super.onSaveInstanceState();
  if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_save_instance_state}")) {
    // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
    if (JRubyAdapter.isJRubyPreOneSeven()) {
      JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
      return (android.os.Parcelable) JRubyAdapter.runScriptlet("$ruby_instance.on_save_instance_state()");
    } else {
      if (JRubyAdapter.isJRubyOneSeven()) {
        return (android.os.Parcelable) JRubyAdapter.runRubyMethod(android.os.Parcelable.class, scriptInfo.getRubyInstance(), "on_save_instance_state");
      } else {
        throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
      }
    }
  } else {
    if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onSaveInstanceState}")) {
      // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
      if (JRubyAdapter.isJRubyPreOneSeven()) {
        JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
        return (android.os.Parcelable) JRubyAdapter.runScriptlet("$ruby_instance.onSaveInstanceState()");
      } else {
        if (JRubyAdapter.isJRubyOneSeven()) {
          return (android.os.Parcelable) JRubyAdapter.runRubyMethod(android.os.Parcelable.class, scriptInfo.getRubyInstance(), "onSaveInstanceState");
        } else {
          throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
        }
      }
    } else {
      return super.onSaveInstanceState();
    }
  }
}
 
开发者ID:Nitrino,项目名称:ruboto_audio,代码行数:39,代码来源:GraphicsView.java

示例12: onSetAlpha

import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public boolean onSetAlpha(int alpha) {
  if (ScriptLoader.isCalledFromJRuby()) return super.onSetAlpha(alpha);
  if (!JRubyAdapter.isInitialized()) {
    Log.i("Method called before JRuby runtime was initialized: GraphicsView#onSetAlpha");
    return super.onSetAlpha(alpha);
  }
  String rubyClassName = scriptInfo.getRubyClassName();
  if (rubyClassName == null) return super.onSetAlpha(alpha);
  if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_set_alpha}")) {
    // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
    if (JRubyAdapter.isJRubyPreOneSeven()) {
      JRubyAdapter.put("$arg_alpha", alpha);
      JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
      return (Boolean) JRubyAdapter.runScriptlet("$ruby_instance.on_set_alpha($arg_alpha)");
    } else {
      if (JRubyAdapter.isJRubyOneSeven()) {
        return (Boolean) JRubyAdapter.runRubyMethod(Boolean.class, scriptInfo.getRubyInstance(), "on_set_alpha", alpha);
      } else {
        throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
      }
    }
  } else {
    if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onSetAlpha}")) {
      // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
      if (JRubyAdapter.isJRubyPreOneSeven()) {
        JRubyAdapter.put("$arg_alpha", alpha);
        JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
        return (Boolean) JRubyAdapter.runScriptlet("$ruby_instance.onSetAlpha($arg_alpha)");
      } else {
        if (JRubyAdapter.isJRubyOneSeven()) {
          return (Boolean) JRubyAdapter.runRubyMethod(Boolean.class, scriptInfo.getRubyInstance(), "onSetAlpha", alpha);
        } else {
          throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
        }
      }
    } else {
      return super.onSetAlpha(alpha);
    }
  }
}
 
开发者ID:Nitrino,项目名称:ruboto_audio,代码行数:41,代码来源:GraphicsView.java

示例13: onKeyLongPress

import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public boolean onKeyLongPress(int keyCode, android.view.KeyEvent event) {
  if (ScriptLoader.isCalledFromJRuby()) return super.onKeyLongPress(keyCode, event);
  if (!JRubyAdapter.isInitialized()) {
    Log.i("Method called before JRuby runtime was initialized: GraphicsView#onKeyLongPress");
    return super.onKeyLongPress(keyCode, event);
  }
  String rubyClassName = scriptInfo.getRubyClassName();
  if (rubyClassName == null) return super.onKeyLongPress(keyCode, event);
  if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_key_long_press}")) {
    // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
    if (JRubyAdapter.isJRubyPreOneSeven()) {
      JRubyAdapter.put("$arg_keyCode", keyCode);
      JRubyAdapter.put("$arg_event", event);
      JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
      return (Boolean) JRubyAdapter.runScriptlet("$ruby_instance.on_key_long_press($arg_keyCode, $arg_event)");
    } else {
      if (JRubyAdapter.isJRubyOneSeven()) {
        return (Boolean) JRubyAdapter.runRubyMethod(Boolean.class, scriptInfo.getRubyInstance(), "on_key_long_press", new Object[]{keyCode, event});
      } else {
        throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
      }
    }
  } else {
    if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onKeyLongPress}")) {
      // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
      if (JRubyAdapter.isJRubyPreOneSeven()) {
        JRubyAdapter.put("$arg_keyCode", keyCode);
        JRubyAdapter.put("$arg_event", event);
        JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
        return (Boolean) JRubyAdapter.runScriptlet("$ruby_instance.onKeyLongPress($arg_keyCode, $arg_event)");
      } else {
        if (JRubyAdapter.isJRubyOneSeven()) {
          return (Boolean) JRubyAdapter.runRubyMethod(Boolean.class, scriptInfo.getRubyInstance(), "onKeyLongPress", new Object[]{keyCode, event});
        } else {
          throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
        }
      }
    } else {
      return super.onKeyLongPress(keyCode, event);
    }
  }
}
 
开发者ID:Nitrino,项目名称:ruboto_audio,代码行数:43,代码来源:GraphicsView.java

示例14: onVisibilityChanged

import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public void onVisibilityChanged(android.view.View changedView, int visibility) {
  if (ScriptLoader.isCalledFromJRuby()) {super.onVisibilityChanged(changedView, visibility); return;}
  if (!JRubyAdapter.isInitialized()) {
    Log.i("Method called before JRuby runtime was initialized: GraphicsView#onVisibilityChanged");
    {super.onVisibilityChanged(changedView, visibility); return;}
  }
  String rubyClassName = scriptInfo.getRubyClassName();
  if (rubyClassName == null) {super.onVisibilityChanged(changedView, visibility); return;}
  if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_visibility_changed}")) {
    // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
    if (JRubyAdapter.isJRubyPreOneSeven()) {
      JRubyAdapter.put("$arg_changedView", changedView);
      JRubyAdapter.put("$arg_visibility", visibility);
      JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
      JRubyAdapter.runScriptlet("$ruby_instance.on_visibility_changed($arg_changedView, $arg_visibility)");
    } else {
      if (JRubyAdapter.isJRubyOneSeven()) {
        JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "on_visibility_changed", new Object[]{changedView, visibility});
      } else {
        throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
      }
    }
  } else {
    if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onVisibilityChanged}")) {
      // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
      if (JRubyAdapter.isJRubyPreOneSeven()) {
        JRubyAdapter.put("$arg_changedView", changedView);
        JRubyAdapter.put("$arg_visibility", visibility);
        JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
        JRubyAdapter.runScriptlet("$ruby_instance.onVisibilityChanged($arg_changedView, $arg_visibility)");
      } else {
        if (JRubyAdapter.isJRubyOneSeven()) {
          JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "onVisibilityChanged", new Object[]{changedView, visibility});
        } else {
          throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
        }
      }
    } else {
      {super.onVisibilityChanged(changedView, visibility); return;}
    }
  }
}
 
开发者ID:Nitrino,项目名称:ruboto_audio,代码行数:43,代码来源:GraphicsView.java

示例15: onKeyMultiple

import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public boolean onKeyMultiple(int keyCode, int repeatCount, android.view.KeyEvent event) {
  if (ScriptLoader.isCalledFromJRuby()) return super.onKeyMultiple(keyCode, repeatCount, event);
  if (!JRubyAdapter.isInitialized()) {
    Log.i("Method called before JRuby runtime was initialized: GraphicsView#onKeyMultiple");
    return super.onKeyMultiple(keyCode, repeatCount, event);
  }
  String rubyClassName = scriptInfo.getRubyClassName();
  if (rubyClassName == null) return super.onKeyMultiple(keyCode, repeatCount, event);
  if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_key_multiple}")) {
    // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
    if (JRubyAdapter.isJRubyPreOneSeven()) {
      JRubyAdapter.put("$arg_keyCode", keyCode);
      JRubyAdapter.put("$arg_repeatCount", repeatCount);
      JRubyAdapter.put("$arg_event", event);
      JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
      return (Boolean) JRubyAdapter.runScriptlet("$ruby_instance.on_key_multiple($arg_keyCode, $arg_repeatCount, $arg_event)");
    } else {
      if (JRubyAdapter.isJRubyOneSeven()) {
        return (Boolean) JRubyAdapter.runRubyMethod(Boolean.class, scriptInfo.getRubyInstance(), "on_key_multiple", new Object[]{keyCode, repeatCount, event});
      } else {
        throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
      }
    }
  } else {
    if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onKeyMultiple}")) {
      // FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
      if (JRubyAdapter.isJRubyPreOneSeven()) {
        JRubyAdapter.put("$arg_keyCode", keyCode);
        JRubyAdapter.put("$arg_repeatCount", repeatCount);
        JRubyAdapter.put("$arg_event", event);
        JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
        return (Boolean) JRubyAdapter.runScriptlet("$ruby_instance.onKeyMultiple($arg_keyCode, $arg_repeatCount, $arg_event)");
      } else {
        if (JRubyAdapter.isJRubyOneSeven()) {
          return (Boolean) JRubyAdapter.runRubyMethod(Boolean.class, scriptInfo.getRubyInstance(), "onKeyMultiple", new Object[]{keyCode, repeatCount, event});
        } else {
          throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
        }
      }
    } else {
      return super.onKeyMultiple(keyCode, repeatCount, event);
    }
  }
}
 
开发者ID:Nitrino,项目名称:ruboto_audio,代码行数:45,代码来源:GraphicsView.java


注:本文中的org.ruboto.JRubyAdapter.isJRubyOneSeven方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。