id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
161,500 | actframework/actframework | src/main/java/act/ws/WebSocketContext.java | WebSocketContext.sendToTagged | public WebSocketContext sendToTagged(String message, String tag) {
return sendToTagged(message, tag, false);
} | java | public WebSocketContext sendToTagged(String message, String tag) {
return sendToTagged(message, tag, false);
} | [
"public",
"WebSocketContext",
"sendToTagged",
"(",
"String",
"message",
",",
"String",
"tag",
")",
"{",
"return",
"sendToTagged",
"(",
"message",
",",
"tag",
",",
"false",
")",
";",
"}"
] | Send message to all connections labeled with tag specified
with self connection excluded
@param message the message to be sent
@param tag the string that tag the connections to be sent
@return this context | [
"Send",
"message",
"to",
"all",
"connections",
"labeled",
"with",
"tag",
"specified",
"with",
"self",
"connection",
"excluded"
] | 55a8f8b45e71159a79ec6e157c02f71700f8cd54 | https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/ws/WebSocketContext.java#L220-L222 |
161,501 | actframework/actframework | src/main/java/act/ws/WebSocketContext.java | WebSocketContext.sendToTagged | public WebSocketContext sendToTagged(String message, String tag, boolean excludeSelf) {
return sendToConnections(message, tag, manager.tagRegistry(), excludeSelf);
} | java | public WebSocketContext sendToTagged(String message, String tag, boolean excludeSelf) {
return sendToConnections(message, tag, manager.tagRegistry(), excludeSelf);
} | [
"public",
"WebSocketContext",
"sendToTagged",
"(",
"String",
"message",
",",
"String",
"tag",
",",
"boolean",
"excludeSelf",
")",
"{",
"return",
"sendToConnections",
"(",
"message",
",",
"tag",
",",
"manager",
".",
"tagRegistry",
"(",
")",
",",
"excludeSelf",
... | Send message to all connections labeled with tag specified.
@param message the message to be sent
@param tag the string that tag the connections to be sent
@param excludeSelf specify whether the connection of this context should be send
@return this context | [
"Send",
"message",
"to",
"all",
"connections",
"labeled",
"with",
"tag",
"specified",
"."
] | 55a8f8b45e71159a79ec6e157c02f71700f8cd54 | https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/ws/WebSocketContext.java#L232-L234 |
161,502 | actframework/actframework | src/main/java/act/ws/WebSocketContext.java | WebSocketContext.sendToUser | public WebSocketContext sendToUser(String message, String username) {
return sendToConnections(message, username, manager.usernameRegistry(), true);
} | java | public WebSocketContext sendToUser(String message, String username) {
return sendToConnections(message, username, manager.usernameRegistry(), true);
} | [
"public",
"WebSocketContext",
"sendToUser",
"(",
"String",
"message",
",",
"String",
"username",
")",
"{",
"return",
"sendToConnections",
"(",
"message",
",",
"username",
",",
"manager",
".",
"usernameRegistry",
"(",
")",
",",
"true",
")",
";",
"}"
] | Send message to all connections of a certain user
@param message the message to be sent
@param username the username
@return this context | [
"Send",
"message",
"to",
"all",
"connections",
"of",
"a",
"certain",
"user"
] | 55a8f8b45e71159a79ec6e157c02f71700f8cd54 | https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/ws/WebSocketContext.java#L269-L271 |
161,503 | actframework/actframework | src/main/java/act/ws/WebSocketContext.java | WebSocketContext.sendJsonToUser | public WebSocketContext sendJsonToUser(Object data, String username) {
return sendToTagged(JSON.toJSONString(data), username);
} | java | public WebSocketContext sendJsonToUser(Object data, String username) {
return sendToTagged(JSON.toJSONString(data), username);
} | [
"public",
"WebSocketContext",
"sendJsonToUser",
"(",
"Object",
"data",
",",
"String",
"username",
")",
"{",
"return",
"sendToTagged",
"(",
"JSON",
".",
"toJSONString",
"(",
"data",
")",
",",
"username",
")",
";",
"}"
] | Send JSON representation of a data object to all connections of a certain user
@param data the data to be sent
@param username the username
@return this context | [
"Send",
"JSON",
"representation",
"of",
"a",
"data",
"object",
"to",
"all",
"connections",
"of",
"a",
"certain",
"user"
] | 55a8f8b45e71159a79ec6e157c02f71700f8cd54 | https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/ws/WebSocketContext.java#L280-L282 |
161,504 | noboomu/proteus | core/src/main/java/io/sinistral/proteus/modules/ApplicationModule.java | ApplicationModule.bindMappers | public void bindMappers()
{
JacksonXmlModule xmlModule = new JacksonXmlModule();
xmlModule.setDefaultUseWrapper(false);
XmlMapper xmlMapper = new XmlMapper(xmlModule);
xmlMapper.enable(ToXmlGenerator.Feature.WRITE_XML_DECLARATION);
this.bind(XmlMapper.class).toInstance(xm... | java | public void bindMappers()
{
JacksonXmlModule xmlModule = new JacksonXmlModule();
xmlModule.setDefaultUseWrapper(false);
XmlMapper xmlMapper = new XmlMapper(xmlModule);
xmlMapper.enable(ToXmlGenerator.Feature.WRITE_XML_DECLARATION);
this.bind(XmlMapper.class).toInstance(xm... | [
"public",
"void",
"bindMappers",
"(",
")",
"{",
"JacksonXmlModule",
"xmlModule",
"=",
"new",
"JacksonXmlModule",
"(",
")",
";",
"xmlModule",
".",
"setDefaultUseWrapper",
"(",
"false",
")",
";",
"XmlMapper",
"xmlMapper",
"=",
"new",
"XmlMapper",
"(",
"xmlModule",... | Override for customizing XmlMapper and ObjectMapper | [
"Override",
"for",
"customizing",
"XmlMapper",
"and",
"ObjectMapper"
] | 9bf999e19e9b491b13912f3ee0e3fbefdbacc509 | https://github.com/noboomu/proteus/blob/9bf999e19e9b491b13912f3ee0e3fbefdbacc509/core/src/main/java/io/sinistral/proteus/modules/ApplicationModule.java#L50-L76 |
161,505 | noboomu/proteus | swagger/src/main/java/io/sinistral/proteus/swagger/jaxrs2/Reader.java | Reader.read | public Swagger read(Set<Class<?>> classes) {
Set<Class<?>> sortedClasses = new TreeSet<>((class1, class2) -> {
if (class1.equals(class2)) {
return 0;
} else if (class1.isAssignableFrom(class2)) {
return -1;
} else if (class2.isAssignableFrom(cl... | java | public Swagger read(Set<Class<?>> classes) {
Set<Class<?>> sortedClasses = new TreeSet<>((class1, class2) -> {
if (class1.equals(class2)) {
return 0;
} else if (class1.isAssignableFrom(class2)) {
return -1;
} else if (class2.isAssignableFrom(cl... | [
"public",
"Swagger",
"read",
"(",
"Set",
"<",
"Class",
"<",
"?",
">",
">",
"classes",
")",
"{",
"Set",
"<",
"Class",
"<",
"?",
">",
">",
"sortedClasses",
"=",
"new",
"TreeSet",
"<>",
"(",
"(",
"class1",
",",
"class2",
")",
"->",
"{",
"if",
"(",
... | Scans a set of classes for both ReaderListeners and Swagger annotations. All found listeners will
be instantiated before any of the classes are scanned for Swagger annotations - so they can be invoked
accordingly.
@param classes a set of classes to scan
@return the generated Swagger definition | [
"Scans",
"a",
"set",
"of",
"classes",
"for",
"both",
"ReaderListeners",
"and",
"Swagger",
"annotations",
".",
"All",
"found",
"listeners",
"will",
"be",
"instantiated",
"before",
"any",
"of",
"the",
"classes",
"are",
"scanned",
"for",
"Swagger",
"annotations",
... | 9bf999e19e9b491b13912f3ee0e3fbefdbacc509 | https://github.com/noboomu/proteus/blob/9bf999e19e9b491b13912f3ee0e3fbefdbacc509/swagger/src/main/java/io/sinistral/proteus/swagger/jaxrs2/Reader.java#L97-L151 |
161,506 | noboomu/proteus | swagger/src/main/java/io/sinistral/proteus/swagger/jaxrs2/Reader.java | Reader.read | public Swagger read(Class<?> cls) {
SwaggerDefinition swaggerDefinition = cls.getAnnotation(SwaggerDefinition.class);
if (swaggerDefinition != null) {
readSwaggerConfig(cls, swaggerDefinition);
}
return read(cls, "", null, false, new String[0], new String[0], new LinkedHashM... | java | public Swagger read(Class<?> cls) {
SwaggerDefinition swaggerDefinition = cls.getAnnotation(SwaggerDefinition.class);
if (swaggerDefinition != null) {
readSwaggerConfig(cls, swaggerDefinition);
}
return read(cls, "", null, false, new String[0], new String[0], new LinkedHashM... | [
"public",
"Swagger",
"read",
"(",
"Class",
"<",
"?",
">",
"cls",
")",
"{",
"SwaggerDefinition",
"swaggerDefinition",
"=",
"cls",
".",
"getAnnotation",
"(",
"SwaggerDefinition",
".",
"class",
")",
";",
"if",
"(",
"swaggerDefinition",
"!=",
"null",
")",
"{",
... | Scans a single class for Swagger annotations - does not invoke ReaderListeners | [
"Scans",
"a",
"single",
"class",
"for",
"Swagger",
"annotations",
"-",
"does",
"not",
"invoke",
"ReaderListeners"
] | 9bf999e19e9b491b13912f3ee0e3fbefdbacc509 | https://github.com/noboomu/proteus/blob/9bf999e19e9b491b13912f3ee0e3fbefdbacc509/swagger/src/main/java/io/sinistral/proteus/swagger/jaxrs2/Reader.java#L156-L163 |
161,507 | noboomu/proteus | core/src/main/java/io/sinistral/proteus/server/handlers/HandlerGenerator.java | HandlerGenerator.generateRoutes | protected void generateRoutes()
{
try {
// Optional<io.sinistral.proteus.annotations.Chain> typeLevelWrapAnnotation = Optional.ofNullable(controllerClass.getAnnotation(io.sinistral.proteus.annotations.Chain.class));
//
// typeLevelWrapAnnotation.ifPresent( a -> {
//
// io.sinistral.proteus.a... | java | protected void generateRoutes()
{
try {
// Optional<io.sinistral.proteus.annotations.Chain> typeLevelWrapAnnotation = Optional.ofNullable(controllerClass.getAnnotation(io.sinistral.proteus.annotations.Chain.class));
//
// typeLevelWrapAnnotation.ifPresent( a -> {
//
// io.sinistral.proteus.a... | [
"protected",
"void",
"generateRoutes",
"(",
")",
"{",
"try",
"{",
"//\t\t\tOptional<io.sinistral.proteus.annotations.Chain> typeLevelWrapAnnotation = Optional.ofNullable(controllerClass.getAnnotation(io.sinistral.proteus.annotations.Chain.class));",
"//\t\t\t",
"//\t\t\ttypeLevelWrapAnnotation.i... | Generates the routing Java source code | [
"Generates",
"the",
"routing",
"Java",
"source",
"code"
] | 9bf999e19e9b491b13912f3ee0e3fbefdbacc509 | https://github.com/noboomu/proteus/blob/9bf999e19e9b491b13912f3ee0e3fbefdbacc509/core/src/main/java/io/sinistral/proteus/server/handlers/HandlerGenerator.java#L128-L224 |
161,508 | noboomu/proteus | core/src/main/java/io/sinistral/proteus/ProteusApplication.java | ProteusApplication.addDefaultRoutes | public ProteusApplication addDefaultRoutes(RoutingHandler router)
{
if (config.hasPath("health.statusPath")) {
try {
final String statusPath = config.getString("health.statusPath");
router.add(Methods.GET, statusPath, (final HttpServerExchange exchange) ->
... | java | public ProteusApplication addDefaultRoutes(RoutingHandler router)
{
if (config.hasPath("health.statusPath")) {
try {
final String statusPath = config.getString("health.statusPath");
router.add(Methods.GET, statusPath, (final HttpServerExchange exchange) ->
... | [
"public",
"ProteusApplication",
"addDefaultRoutes",
"(",
"RoutingHandler",
"router",
")",
"{",
"if",
"(",
"config",
".",
"hasPath",
"(",
"\"health.statusPath\"",
")",
")",
"{",
"try",
"{",
"final",
"String",
"statusPath",
"=",
"config",
".",
"getString",
"(",
... | Add utility routes the router
@param router | [
"Add",
"utility",
"routes",
"the",
"router"
] | 9bf999e19e9b491b13912f3ee0e3fbefdbacc509 | https://github.com/noboomu/proteus/blob/9bf999e19e9b491b13912f3ee0e3fbefdbacc509/core/src/main/java/io/sinistral/proteus/ProteusApplication.java#L362-L434 |
161,509 | noboomu/proteus | core/src/main/java/io/sinistral/proteus/ProteusApplication.java | ProteusApplication.setServerConfigurationFunction | public ProteusApplication setServerConfigurationFunction(Function<Undertow.Builder, Undertow.Builder> serverConfigurationFunction)
{
this.serverConfigurationFunction = serverConfigurationFunction;
return this;
} | java | public ProteusApplication setServerConfigurationFunction(Function<Undertow.Builder, Undertow.Builder> serverConfigurationFunction)
{
this.serverConfigurationFunction = serverConfigurationFunction;
return this;
} | [
"public",
"ProteusApplication",
"setServerConfigurationFunction",
"(",
"Function",
"<",
"Undertow",
".",
"Builder",
",",
"Undertow",
".",
"Builder",
">",
"serverConfigurationFunction",
")",
"{",
"this",
".",
"serverConfigurationFunction",
"=",
"serverConfigurationFunction",... | Allows direct access to the Undertow.Builder for custom configuration
@param serverConfigurationFunction the serverConfigurationFunction | [
"Allows",
"direct",
"access",
"to",
"the",
"Undertow",
".",
"Builder",
"for",
"custom",
"configuration"
] | 9bf999e19e9b491b13912f3ee0e3fbefdbacc509 | https://github.com/noboomu/proteus/blob/9bf999e19e9b491b13912f3ee0e3fbefdbacc509/core/src/main/java/io/sinistral/proteus/ProteusApplication.java#L465-L469 |
161,510 | felipecsl/AsymmetricGridView | library/src/main/java/com/felipecsl/asymmetricgridview/Utils.java | Utils.getDisplayMetrics | static DisplayMetrics getDisplayMetrics(final Context context) {
final WindowManager
windowManager =
(WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
final DisplayMetrics metrics = new DisplayMetrics();
windowManager.getDefaultDisplay().getMetrics(metrics);
return metric... | java | static DisplayMetrics getDisplayMetrics(final Context context) {
final WindowManager
windowManager =
(WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
final DisplayMetrics metrics = new DisplayMetrics();
windowManager.getDefaultDisplay().getMetrics(metrics);
return metric... | [
"static",
"DisplayMetrics",
"getDisplayMetrics",
"(",
"final",
"Context",
"context",
")",
"{",
"final",
"WindowManager",
"windowManager",
"=",
"(",
"WindowManager",
")",
"context",
".",
"getSystemService",
"(",
"Context",
".",
"WINDOW_SERVICE",
")",
";",
"final",
... | Returns a valid DisplayMetrics object
@param context valid context
@return DisplayMetrics object | [
"Returns",
"a",
"valid",
"DisplayMetrics",
"object"
] | f8c3d6da518a85218c3627b93ec62415befe7a6a | https://github.com/felipecsl/AsymmetricGridView/blob/f8c3d6da518a85218c3627b93ec62415befe7a6a/library/src/main/java/com/felipecsl/asymmetricgridview/Utils.java#L27-L34 |
161,511 | patrickfav/Dali | dali/src/main/java/at/favre/lib/dali/builder/live/LiveBlurWorker.java | LiveBlurWorker.crop | private static Bitmap crop(Bitmap srcBmp, View canvasView, int downsampling) {
float scale = 1f / downsampling;
return Bitmap.createBitmap(
srcBmp,
(int) Math.floor((ViewCompat.getX(canvasView)) * scale),
(int) Math.floor((ViewCompat.getY(canvasView)) * sc... | java | private static Bitmap crop(Bitmap srcBmp, View canvasView, int downsampling) {
float scale = 1f / downsampling;
return Bitmap.createBitmap(
srcBmp,
(int) Math.floor((ViewCompat.getX(canvasView)) * scale),
(int) Math.floor((ViewCompat.getY(canvasView)) * sc... | [
"private",
"static",
"Bitmap",
"crop",
"(",
"Bitmap",
"srcBmp",
",",
"View",
"canvasView",
",",
"int",
"downsampling",
")",
"{",
"float",
"scale",
"=",
"1f",
"/",
"downsampling",
";",
"return",
"Bitmap",
".",
"createBitmap",
"(",
"srcBmp",
",",
"(",
"int",... | crops the srcBmp with the canvasView bounds and returns the cropped bitmap | [
"crops",
"the",
"srcBmp",
"with",
"the",
"canvasView",
"bounds",
"and",
"returns",
"the",
"cropped",
"bitmap"
] | 4c90a8c174517873844638d4b8349d890453cc17 | https://github.com/patrickfav/Dali/blob/4c90a8c174517873844638d4b8349d890453cc17/dali/src/main/java/at/favre/lib/dali/builder/live/LiveBlurWorker.java#L102-L111 |
161,512 | patrickfav/Dali | dali/src/main/java/at/favre/lib/dali/builder/PerformanceProfiler.java | PerformanceProfiler.startTask | public void startTask(int id, String taskName) {
if (isActivated) {
durations.add(new Duration(id, taskName, BenchmarkUtil.elapsedRealTimeNanos()));
}
} | java | public void startTask(int id, String taskName) {
if (isActivated) {
durations.add(new Duration(id, taskName, BenchmarkUtil.elapsedRealTimeNanos()));
}
} | [
"public",
"void",
"startTask",
"(",
"int",
"id",
",",
"String",
"taskName",
")",
"{",
"if",
"(",
"isActivated",
")",
"{",
"durations",
".",
"add",
"(",
"new",
"Duration",
"(",
"id",
",",
"taskName",
",",
"BenchmarkUtil",
".",
"elapsedRealTimeNanos",
"(",
... | Start a task. The id is needed to end the task
@param id
@param taskName | [
"Start",
"a",
"task",
".",
"The",
"id",
"is",
"needed",
"to",
"end",
"the",
"task"
] | 4c90a8c174517873844638d4b8349d890453cc17 | https://github.com/patrickfav/Dali/blob/4c90a8c174517873844638d4b8349d890453cc17/dali/src/main/java/at/favre/lib/dali/builder/PerformanceProfiler.java#L43-L47 |
161,513 | patrickfav/Dali | dali/src/main/java/at/favre/lib/dali/builder/PerformanceProfiler.java | PerformanceProfiler.getDurationMs | public double getDurationMs() {
double durationMs = 0;
for (Duration duration : durations) {
if (duration.taskFinished()) {
durationMs += duration.getDurationMS();
}
}
return durationMs;
} | java | public double getDurationMs() {
double durationMs = 0;
for (Duration duration : durations) {
if (duration.taskFinished()) {
durationMs += duration.getDurationMS();
}
}
return durationMs;
} | [
"public",
"double",
"getDurationMs",
"(",
")",
"{",
"double",
"durationMs",
"=",
"0",
";",
"for",
"(",
"Duration",
"duration",
":",
"durations",
")",
"{",
"if",
"(",
"duration",
".",
"taskFinished",
"(",
")",
")",
"{",
"durationMs",
"+=",
"duration",
"."... | Returns the duration of the measured tasks in ms | [
"Returns",
"the",
"duration",
"of",
"the",
"measured",
"tasks",
"in",
"ms"
] | 4c90a8c174517873844638d4b8349d890453cc17 | https://github.com/patrickfav/Dali/blob/4c90a8c174517873844638d4b8349d890453cc17/dali/src/main/java/at/favre/lib/dali/builder/PerformanceProfiler.java#L71-L79 |
161,514 | patrickfav/Dali | dali/src/main/java/at/favre/lib/dali/util/LegacySDKUtil.java | LegacySDKUtil.setViewBackground | public static void setViewBackground(View v, Drawable d) {
if (Build.VERSION.SDK_INT >= 16) {
v.setBackground(d);
} else {
v.setBackgroundDrawable(d);
}
} | java | public static void setViewBackground(View v, Drawable d) {
if (Build.VERSION.SDK_INT >= 16) {
v.setBackground(d);
} else {
v.setBackgroundDrawable(d);
}
} | [
"public",
"static",
"void",
"setViewBackground",
"(",
"View",
"v",
",",
"Drawable",
"d",
")",
"{",
"if",
"(",
"Build",
".",
"VERSION",
".",
"SDK_INT",
">=",
"16",
")",
"{",
"v",
".",
"setBackground",
"(",
"d",
")",
";",
"}",
"else",
"{",
"v",
".",
... | legacy helper for setting background | [
"legacy",
"helper",
"for",
"setting",
"background"
] | 4c90a8c174517873844638d4b8349d890453cc17 | https://github.com/patrickfav/Dali/blob/4c90a8c174517873844638d4b8349d890453cc17/dali/src/main/java/at/favre/lib/dali/util/LegacySDKUtil.java#L36-L42 |
161,515 | patrickfav/Dali | dali/src/main/java/at/favre/lib/dali/util/LegacySDKUtil.java | LegacySDKUtil.byteSizeOf | public static int byteSizeOf(Bitmap bitmap) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
return bitmap.getAllocationByteCount();
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) {
return bitmap.getByteCount();
} else {
ret... | java | public static int byteSizeOf(Bitmap bitmap) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
return bitmap.getAllocationByteCount();
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) {
return bitmap.getByteCount();
} else {
ret... | [
"public",
"static",
"int",
"byteSizeOf",
"(",
"Bitmap",
"bitmap",
")",
"{",
"if",
"(",
"Build",
".",
"VERSION",
".",
"SDK_INT",
">=",
"Build",
".",
"VERSION_CODES",
".",
"KITKAT",
")",
"{",
"return",
"bitmap",
".",
"getAllocationByteCount",
"(",
")",
";",
... | returns the bytesize of the give bitmap | [
"returns",
"the",
"bytesize",
"of",
"the",
"give",
"bitmap"
] | 4c90a8c174517873844638d4b8349d890453cc17 | https://github.com/patrickfav/Dali/blob/4c90a8c174517873844638d4b8349d890453cc17/dali/src/main/java/at/favre/lib/dali/util/LegacySDKUtil.java#L47-L55 |
161,516 | patrickfav/Dali | dali/src/main/java/at/favre/lib/dali/util/LegacySDKUtil.java | LegacySDKUtil.getCacheDir | public static String getCacheDir(Context ctx) {
return Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState()) || (!Environment.isExternalStorageRemovable() && ctx.getExternalCacheDir() != null) ?
ctx.getExternalCacheDir().getPath() : ctx.getCacheDir().getPath();
} | java | public static String getCacheDir(Context ctx) {
return Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState()) || (!Environment.isExternalStorageRemovable() && ctx.getExternalCacheDir() != null) ?
ctx.getExternalCacheDir().getPath() : ctx.getCacheDir().getPath();
} | [
"public",
"static",
"String",
"getCacheDir",
"(",
"Context",
"ctx",
")",
"{",
"return",
"Environment",
".",
"MEDIA_MOUNTED",
".",
"equals",
"(",
"Environment",
".",
"getExternalStorageState",
"(",
")",
")",
"||",
"(",
"!",
"Environment",
".",
"isExternalStorageR... | Gets the appropriate cache dir
@param ctx
@return | [
"Gets",
"the",
"appropriate",
"cache",
"dir"
] | 4c90a8c174517873844638d4b8349d890453cc17 | https://github.com/patrickfav/Dali/blob/4c90a8c174517873844638d4b8349d890453cc17/dali/src/main/java/at/favre/lib/dali/util/LegacySDKUtil.java#L72-L75 |
161,517 | patrickfav/Dali | dali/src/main/java/at/favre/lib/dali/builder/ImageReference.java | ImageReference.measureImage | public Point measureImage(Resources resources) {
BitmapFactory.Options justBoundsOptions = new BitmapFactory.Options();
justBoundsOptions.inJustDecodeBounds = true;
if (bitmap != null) {
return new Point(bitmap.getWidth(), bitmap.getHeight());
} else if (resId != null) {
... | java | public Point measureImage(Resources resources) {
BitmapFactory.Options justBoundsOptions = new BitmapFactory.Options();
justBoundsOptions.inJustDecodeBounds = true;
if (bitmap != null) {
return new Point(bitmap.getWidth(), bitmap.getHeight());
} else if (resId != null) {
... | [
"public",
"Point",
"measureImage",
"(",
"Resources",
"resources",
")",
"{",
"BitmapFactory",
".",
"Options",
"justBoundsOptions",
"=",
"new",
"BitmapFactory",
".",
"Options",
"(",
")",
";",
"justBoundsOptions",
".",
"inJustDecodeBounds",
"=",
"true",
";",
"if",
... | If the not a bitmap itself, this will read the file's meta data.
@param resources {@link android.content.Context#getResources()}
@return Point where x = width and y = height | [
"If",
"the",
"not",
"a",
"bitmap",
"itself",
"this",
"will",
"read",
"the",
"file",
"s",
"meta",
"data",
"."
] | 4c90a8c174517873844638d4b8349d890453cc17 | https://github.com/patrickfav/Dali/blob/4c90a8c174517873844638d4b8349d890453cc17/dali/src/main/java/at/favre/lib/dali/builder/ImageReference.java#L153-L175 |
161,518 | patrickfav/Dali | dali/src/main/java/at/favre/lib/dali/builder/ExecutorManager.java | ExecutorManager.cancelByTag | public synchronized int cancelByTag(String tagToCancel) {
int i = 0;
if (taskList.containsKey(tagToCancel)) {
removeDoneTasks();
for (Future<BlurWorker.Result> future : taskList.get(tagToCancel)) {
BuilderUtil.logVerbose(Dali.getConfig().logTag, "Canceling task w... | java | public synchronized int cancelByTag(String tagToCancel) {
int i = 0;
if (taskList.containsKey(tagToCancel)) {
removeDoneTasks();
for (Future<BlurWorker.Result> future : taskList.get(tagToCancel)) {
BuilderUtil.logVerbose(Dali.getConfig().logTag, "Canceling task w... | [
"public",
"synchronized",
"int",
"cancelByTag",
"(",
"String",
"tagToCancel",
")",
"{",
"int",
"i",
"=",
"0",
";",
"if",
"(",
"taskList",
".",
"containsKey",
"(",
"tagToCancel",
")",
")",
"{",
"removeDoneTasks",
"(",
")",
";",
"for",
"(",
"Future",
"<",
... | Cancel all task with this tag and returns the canceled task count
@param tagToCancel
@return | [
"Cancel",
"all",
"task",
"with",
"this",
"tag",
"and",
"returns",
"the",
"canceled",
"task",
"count"
] | 4c90a8c174517873844638d4b8349d890453cc17 | https://github.com/patrickfav/Dali/blob/4c90a8c174517873844638d4b8349d890453cc17/dali/src/main/java/at/favre/lib/dali/builder/ExecutorManager.java#L69-L89 |
161,519 | patrickfav/Dali | dali/src/main/java/at/favre/lib/dali/util/BitmapUtil.java | BitmapUtil.flip | public static Bitmap flip(Bitmap src) {
Matrix m = new Matrix();
m.preScale(-1, 1);
return Bitmap.createBitmap(src, 0, 0, src.getWidth(), src.getHeight(), m, false);
} | java | public static Bitmap flip(Bitmap src) {
Matrix m = new Matrix();
m.preScale(-1, 1);
return Bitmap.createBitmap(src, 0, 0, src.getWidth(), src.getHeight(), m, false);
} | [
"public",
"static",
"Bitmap",
"flip",
"(",
"Bitmap",
"src",
")",
"{",
"Matrix",
"m",
"=",
"new",
"Matrix",
"(",
")",
";",
"m",
".",
"preScale",
"(",
"-",
"1",
",",
"1",
")",
";",
"return",
"Bitmap",
".",
"createBitmap",
"(",
"src",
",",
"0",
",",... | Mirrors the given bitmap | [
"Mirrors",
"the",
"given",
"bitmap"
] | 4c90a8c174517873844638d4b8349d890453cc17 | https://github.com/patrickfav/Dali/blob/4c90a8c174517873844638d4b8349d890453cc17/dali/src/main/java/at/favre/lib/dali/util/BitmapUtil.java#L83-L87 |
161,520 | patrickfav/Dali | dali/src/main/java/at/favre/lib/dali/builder/TwoLevelCache.java | TwoLevelCache.purge | public void purge(String cacheKey) {
try {
if (useMemoryCache) {
if (memoryCache != null) {
memoryCache.remove(cacheKey);
}
}
if (useDiskCache) {
if (diskLruCache != null) {
diskLruCache.... | java | public void purge(String cacheKey) {
try {
if (useMemoryCache) {
if (memoryCache != null) {
memoryCache.remove(cacheKey);
}
}
if (useDiskCache) {
if (diskLruCache != null) {
diskLruCache.... | [
"public",
"void",
"purge",
"(",
"String",
"cacheKey",
")",
"{",
"try",
"{",
"if",
"(",
"useMemoryCache",
")",
"{",
"if",
"(",
"memoryCache",
"!=",
"null",
")",
"{",
"memoryCache",
".",
"remove",
"(",
"cacheKey",
")",
";",
"}",
"}",
"if",
"(",
"useDis... | Removes the value connected to the given key
from all levels of the cache. Will not throw an
exception on fail.
@param cacheKey | [
"Removes",
"the",
"value",
"connected",
"to",
"the",
"given",
"key",
"from",
"all",
"levels",
"of",
"the",
"cache",
".",
"Will",
"not",
"throw",
"an",
"exception",
"on",
"fail",
"."
] | 4c90a8c174517873844638d4b8349d890453cc17 | https://github.com/patrickfav/Dali/blob/4c90a8c174517873844638d4b8349d890453cc17/dali/src/main/java/at/favre/lib/dali/builder/TwoLevelCache.java#L223-L239 |
161,521 | patrickfav/Dali | dali/src/main/java/at/favre/lib/dali/builder/ContextWrapper.java | ContextWrapper.getRenderScript | public RenderScript getRenderScript() {
if (renderScript == null) {
renderScript = RenderScript.create(context, renderScriptContextType);
}
return renderScript;
} | java | public RenderScript getRenderScript() {
if (renderScript == null) {
renderScript = RenderScript.create(context, renderScriptContextType);
}
return renderScript;
} | [
"public",
"RenderScript",
"getRenderScript",
"(",
")",
"{",
"if",
"(",
"renderScript",
"==",
"null",
")",
"{",
"renderScript",
"=",
"RenderScript",
".",
"create",
"(",
"context",
",",
"renderScriptContextType",
")",
";",
"}",
"return",
"renderScript",
";",
"}"... | Syncronously creates a Renderscript context if none exists.
Creating a Renderscript context takes about 20 ms in Nexus 5
@return | [
"Syncronously",
"creates",
"a",
"Renderscript",
"context",
"if",
"none",
"exists",
".",
"Creating",
"a",
"Renderscript",
"context",
"takes",
"about",
"20",
"ms",
"in",
"Nexus",
"5"
] | 4c90a8c174517873844638d4b8349d890453cc17 | https://github.com/patrickfav/Dali/blob/4c90a8c174517873844638d4b8349d890453cc17/dali/src/main/java/at/favre/lib/dali/builder/ContextWrapper.java#L34-L39 |
161,522 | patrickfav/Dali | dali/src/main/java/at/favre/lib/dali/builder/nav/DaliBlurDrawerToggle.java | DaliBlurDrawerToggle.renderBlurLayer | private void renderBlurLayer(float slideOffset) {
if (enableBlur) {
if (slideOffset == 0 || forceRedraw) {
clearBlurView();
}
if (slideOffset > 0f && blurView == null) {
if (drawerLayout.getChildCount() == 2) {
blurView = n... | java | private void renderBlurLayer(float slideOffset) {
if (enableBlur) {
if (slideOffset == 0 || forceRedraw) {
clearBlurView();
}
if (slideOffset > 0f && blurView == null) {
if (drawerLayout.getChildCount() == 2) {
blurView = n... | [
"private",
"void",
"renderBlurLayer",
"(",
"float",
"slideOffset",
")",
"{",
"if",
"(",
"enableBlur",
")",
"{",
"if",
"(",
"slideOffset",
"==",
"0",
"||",
"forceRedraw",
")",
"{",
"clearBlurView",
"(",
")",
";",
"}",
"if",
"(",
"slideOffset",
">",
"0f",
... | This will blur the view behind it and set it in
a imageview over the content with a alpha value
that corresponds to slideOffset. | [
"This",
"will",
"blur",
"the",
"view",
"behind",
"it",
"and",
"set",
"it",
"in",
"a",
"imageview",
"over",
"the",
"content",
"with",
"a",
"alpha",
"value",
"that",
"corresponds",
"to",
"slideOffset",
"."
] | 4c90a8c174517873844638d4b8349d890453cc17 | https://github.com/patrickfav/Dali/blob/4c90a8c174517873844638d4b8349d890453cc17/dali/src/main/java/at/favre/lib/dali/builder/nav/DaliBlurDrawerToggle.java#L70-L99 |
161,523 | patrickfav/Dali | dali/src/main/java/at/favre/lib/dali/builder/nav/DaliBlurDrawerToggle.java | DaliBlurDrawerToggle.onDrawerOpened | public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
if (listener != null) listener.onDrawerClosed(drawerView);
} | java | public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
if (listener != null) listener.onDrawerClosed(drawerView);
} | [
"public",
"void",
"onDrawerOpened",
"(",
"View",
"drawerView",
")",
"{",
"super",
".",
"onDrawerOpened",
"(",
"drawerView",
")",
";",
"if",
"(",
"listener",
"!=",
"null",
")",
"listener",
".",
"onDrawerClosed",
"(",
"drawerView",
")",
";",
"}"
] | Called when a drawer has settled in a completely open state. | [
"Called",
"when",
"a",
"drawer",
"has",
"settled",
"in",
"a",
"completely",
"open",
"state",
"."
] | 4c90a8c174517873844638d4b8349d890453cc17 | https://github.com/patrickfav/Dali/blob/4c90a8c174517873844638d4b8349d890453cc17/dali/src/main/java/at/favre/lib/dali/builder/nav/DaliBlurDrawerToggle.java#L149-L152 |
161,524 | patrickfav/Dali | dali/src/main/java/at/favre/lib/dali/util/BuilderUtil.java | BuilderUtil.getIBlurAlgorithm | public static IBlur getIBlurAlgorithm(EBlurAlgorithm algorithm, ContextWrapper contextWrapper) {
RenderScript rs = contextWrapper.getRenderScript();
Context ctx = contextWrapper.getContext();
switch (algorithm) {
case RS_GAUSS_FAST:
return new RenderScriptGaussianBlu... | java | public static IBlur getIBlurAlgorithm(EBlurAlgorithm algorithm, ContextWrapper contextWrapper) {
RenderScript rs = contextWrapper.getRenderScript();
Context ctx = contextWrapper.getContext();
switch (algorithm) {
case RS_GAUSS_FAST:
return new RenderScriptGaussianBlu... | [
"public",
"static",
"IBlur",
"getIBlurAlgorithm",
"(",
"EBlurAlgorithm",
"algorithm",
",",
"ContextWrapper",
"contextWrapper",
")",
"{",
"RenderScript",
"rs",
"=",
"contextWrapper",
".",
"getRenderScript",
"(",
")",
";",
"Context",
"ctx",
"=",
"contextWrapper",
".",... | Creates an IBlur instance for the given algorithm enum
@param algorithm
@param contextWrapper
@return | [
"Creates",
"an",
"IBlur",
"instance",
"for",
"the",
"given",
"algorithm",
"enum"
] | 4c90a8c174517873844638d4b8349d890453cc17 | https://github.com/patrickfav/Dali/blob/4c90a8c174517873844638d4b8349d890453cc17/dali/src/main/java/at/favre/lib/dali/util/BuilderUtil.java#L40-L62 |
161,525 | patrickfav/Dali | dali/src/main/java/at/favre/lib/dali/builder/blur/BlurBuilder.java | BlurBuilder.downScale | public BlurBuilder downScale(int scaleInSample) {
data.options.inSampleSize = Math.min(Math.max(1, scaleInSample), 16384);
return this;
} | java | public BlurBuilder downScale(int scaleInSample) {
data.options.inSampleSize = Math.min(Math.max(1, scaleInSample), 16384);
return this;
} | [
"public",
"BlurBuilder",
"downScale",
"(",
"int",
"scaleInSample",
")",
"{",
"data",
".",
"options",
".",
"inSampleSize",
"=",
"Math",
".",
"min",
"(",
"Math",
".",
"max",
"(",
"1",
",",
"scaleInSample",
")",
",",
"16384",
")",
";",
"return",
"this",
"... | Will scale the image down before processing for
performance enhancement and less memory usage
sacrificing image quality.
@param scaleInSample value greater than 1 will scale the image width/height, so 2 will getFromDiskCache you 1/4
of the original size and 4 will getFromDiskCache you 1/16 of the original size - this ... | [
"Will",
"scale",
"the",
"image",
"down",
"before",
"processing",
"for",
"performance",
"enhancement",
"and",
"less",
"memory",
"usage",
"sacrificing",
"image",
"quality",
"."
] | 4c90a8c174517873844638d4b8349d890453cc17 | https://github.com/patrickfav/Dali/blob/4c90a8c174517873844638d4b8349d890453cc17/dali/src/main/java/at/favre/lib/dali/builder/blur/BlurBuilder.java#L110-L113 |
161,526 | patrickfav/Dali | dali/src/main/java/at/favre/lib/dali/builder/blur/BlurBuilder.java | BlurBuilder.brightness | public BlurBuilder brightness(float brightness) {
data.preProcessors.add(new RenderscriptBrightnessProcessor(data.contextWrapper.getRenderScript(), brightness, data.contextWrapper.getResources()));
return this;
} | java | public BlurBuilder brightness(float brightness) {
data.preProcessors.add(new RenderscriptBrightnessProcessor(data.contextWrapper.getRenderScript(), brightness, data.contextWrapper.getResources()));
return this;
} | [
"public",
"BlurBuilder",
"brightness",
"(",
"float",
"brightness",
")",
"{",
"data",
".",
"preProcessors",
".",
"add",
"(",
"new",
"RenderscriptBrightnessProcessor",
"(",
"data",
".",
"contextWrapper",
".",
"getRenderScript",
"(",
")",
",",
"brightness",
",",
"d... | Set brightness to eg. darken the resulting image for use as background
@param brightness default is 0, pos values increase brightness, neg. values decrease brightness
.-100 is black, positive goes up to 1000+ | [
"Set",
"brightness",
"to",
"eg",
".",
"darken",
"the",
"resulting",
"image",
"for",
"use",
"as",
"background"
] | 4c90a8c174517873844638d4b8349d890453cc17 | https://github.com/patrickfav/Dali/blob/4c90a8c174517873844638d4b8349d890453cc17/dali/src/main/java/at/favre/lib/dali/builder/blur/BlurBuilder.java#L155-L158 |
161,527 | patrickfav/Dali | dali/src/main/java/at/favre/lib/dali/builder/blur/BlurBuilder.java | BlurBuilder.contrast | public BlurBuilder contrast(float contrast) {
data.preProcessors.add(new ContrastProcessor(data.contextWrapper.getRenderScript(), Math.max(Math.min(1500.f, contrast), -1500.f)));
return this;
} | java | public BlurBuilder contrast(float contrast) {
data.preProcessors.add(new ContrastProcessor(data.contextWrapper.getRenderScript(), Math.max(Math.min(1500.f, contrast), -1500.f)));
return this;
} | [
"public",
"BlurBuilder",
"contrast",
"(",
"float",
"contrast",
")",
"{",
"data",
".",
"preProcessors",
".",
"add",
"(",
"new",
"ContrastProcessor",
"(",
"data",
".",
"contextWrapper",
".",
"getRenderScript",
"(",
")",
",",
"Math",
".",
"max",
"(",
"Math",
... | Change contrast of the image
@param contrast default is 0, pos values increase contrast, neg. values decrease contrast | [
"Change",
"contrast",
"of",
"the",
"image"
] | 4c90a8c174517873844638d4b8349d890453cc17 | https://github.com/patrickfav/Dali/blob/4c90a8c174517873844638d4b8349d890453cc17/dali/src/main/java/at/favre/lib/dali/builder/blur/BlurBuilder.java#L165-L168 |
161,528 | patrickfav/Dali | dali/src/main/java/at/favre/lib/dali/Dali.java | Dali.resetAndSetNewConfig | public static synchronized void resetAndSetNewConfig(Context ctx, Config config) {
GLOBAL_CONFIG = config;
if (DISK_CACHE_MANAGER != null) {
DISK_CACHE_MANAGER.clear();
DISK_CACHE_MANAGER = null;
createCache(ctx);
}
if (EXECUTOR_MANAGER != null) {
... | java | public static synchronized void resetAndSetNewConfig(Context ctx, Config config) {
GLOBAL_CONFIG = config;
if (DISK_CACHE_MANAGER != null) {
DISK_CACHE_MANAGER.clear();
DISK_CACHE_MANAGER = null;
createCache(ctx);
}
if (EXECUTOR_MANAGER != null) {
... | [
"public",
"static",
"synchronized",
"void",
"resetAndSetNewConfig",
"(",
"Context",
"ctx",
",",
"Config",
"config",
")",
"{",
"GLOBAL_CONFIG",
"=",
"config",
";",
"if",
"(",
"DISK_CACHE_MANAGER",
"!=",
"null",
")",
"{",
"DISK_CACHE_MANAGER",
".",
"clear",
"(",
... | Sets a new config and clears the previous cache | [
"Sets",
"a",
"new",
"config",
"and",
"clears",
"the",
"previous",
"cache"
] | 4c90a8c174517873844638d4b8349d890453cc17 | https://github.com/patrickfav/Dali/blob/4c90a8c174517873844638d4b8349d890453cc17/dali/src/main/java/at/favre/lib/dali/Dali.java#L49-L63 |
161,529 | arturmkrtchyan/iban4j | src/main/java/org/iban4j/IbanUtil.java | IbanUtil.getIbanLength | public static int getIbanLength(final CountryCode countryCode) {
final BbanStructure structure = getBbanStructure(countryCode);
return COUNTRY_CODE_LENGTH + CHECK_DIGIT_LENGTH + structure.getBbanLength();
} | java | public static int getIbanLength(final CountryCode countryCode) {
final BbanStructure structure = getBbanStructure(countryCode);
return COUNTRY_CODE_LENGTH + CHECK_DIGIT_LENGTH + structure.getBbanLength();
} | [
"public",
"static",
"int",
"getIbanLength",
"(",
"final",
"CountryCode",
"countryCode",
")",
"{",
"final",
"BbanStructure",
"structure",
"=",
"getBbanStructure",
"(",
"countryCode",
")",
";",
"return",
"COUNTRY_CODE_LENGTH",
"+",
"CHECK_DIGIT_LENGTH",
"+",
"structure"... | Returns iban length for the specified country.
@param countryCode {@link org.iban4j.CountryCode}
@return the length of the iban for the specified country. | [
"Returns",
"iban",
"length",
"for",
"the",
"specified",
"country",
"."
] | 9889e8873c4ba5c34fc61d17594af935d2ca28a3 | https://github.com/arturmkrtchyan/iban4j/blob/9889e8873c4ba5c34fc61d17594af935d2ca28a3/src/main/java/org/iban4j/IbanUtil.java#L133-L136 |
161,530 | arturmkrtchyan/iban4j | src/main/java/org/iban4j/IbanUtil.java | IbanUtil.getCountryCodeAndCheckDigit | public static String getCountryCodeAndCheckDigit(final String iban) {
return iban.substring(COUNTRY_CODE_INDEX,
COUNTRY_CODE_INDEX + COUNTRY_CODE_LENGTH + CHECK_DIGIT_LENGTH);
} | java | public static String getCountryCodeAndCheckDigit(final String iban) {
return iban.substring(COUNTRY_CODE_INDEX,
COUNTRY_CODE_INDEX + COUNTRY_CODE_LENGTH + CHECK_DIGIT_LENGTH);
} | [
"public",
"static",
"String",
"getCountryCodeAndCheckDigit",
"(",
"final",
"String",
"iban",
")",
"{",
"return",
"iban",
".",
"substring",
"(",
"COUNTRY_CODE_INDEX",
",",
"COUNTRY_CODE_INDEX",
"+",
"COUNTRY_CODE_LENGTH",
"+",
"CHECK_DIGIT_LENGTH",
")",
";",
"}"
] | Returns iban's country code and check digit.
@param iban String
@return countryCodeAndCheckDigit String | [
"Returns",
"iban",
"s",
"country",
"code",
"and",
"check",
"digit",
"."
] | 9889e8873c4ba5c34fc61d17594af935d2ca28a3 | https://github.com/arturmkrtchyan/iban4j/blob/9889e8873c4ba5c34fc61d17594af935d2ca28a3/src/main/java/org/iban4j/IbanUtil.java#L166-L169 |
161,531 | arturmkrtchyan/iban4j | src/main/java/org/iban4j/IbanUtil.java | IbanUtil.replaceCheckDigit | static String replaceCheckDigit(final String iban, final String checkDigit) {
return getCountryCode(iban) + checkDigit + getBban(iban);
} | java | static String replaceCheckDigit(final String iban, final String checkDigit) {
return getCountryCode(iban) + checkDigit + getBban(iban);
} | [
"static",
"String",
"replaceCheckDigit",
"(",
"final",
"String",
"iban",
",",
"final",
"String",
"checkDigit",
")",
"{",
"return",
"getCountryCode",
"(",
"iban",
")",
"+",
"checkDigit",
"+",
"getBban",
"(",
"iban",
")",
";",
"}"
] | Returns an iban with replaced check digit.
@param iban The iban
@return The iban without the check digit | [
"Returns",
"an",
"iban",
"with",
"replaced",
"check",
"digit",
"."
] | 9889e8873c4ba5c34fc61d17594af935d2ca28a3 | https://github.com/arturmkrtchyan/iban4j/blob/9889e8873c4ba5c34fc61d17594af935d2ca28a3/src/main/java/org/iban4j/IbanUtil.java#L261-L263 |
161,532 | arturmkrtchyan/iban4j | src/main/java/org/iban4j/IbanUtil.java | IbanUtil.toFormattedString | static String toFormattedString(final String iban) {
final StringBuilder ibanBuffer = new StringBuilder(iban);
final int length = ibanBuffer.length();
for (int i = 0; i < length / 4; i++) {
ibanBuffer.insert((i + 1) * 4 + i, ' ');
}
return ibanBuffer.toString().trim... | java | static String toFormattedString(final String iban) {
final StringBuilder ibanBuffer = new StringBuilder(iban);
final int length = ibanBuffer.length();
for (int i = 0; i < length / 4; i++) {
ibanBuffer.insert((i + 1) * 4 + i, ' ');
}
return ibanBuffer.toString().trim... | [
"static",
"String",
"toFormattedString",
"(",
"final",
"String",
"iban",
")",
"{",
"final",
"StringBuilder",
"ibanBuffer",
"=",
"new",
"StringBuilder",
"(",
"iban",
")",
";",
"final",
"int",
"length",
"=",
"ibanBuffer",
".",
"length",
"(",
")",
";",
"for",
... | Returns formatted version of Iban.
@return A string representing formatted Iban for printing. | [
"Returns",
"formatted",
"version",
"of",
"Iban",
"."
] | 9889e8873c4ba5c34fc61d17594af935d2ca28a3 | https://github.com/arturmkrtchyan/iban4j/blob/9889e8873c4ba5c34fc61d17594af935d2ca28a3/src/main/java/org/iban4j/IbanUtil.java#L270-L279 |
161,533 | arturmkrtchyan/iban4j | src/main/java/org/iban4j/Bic.java | Bic.valueOf | public static Bic valueOf(final String bic) throws BicFormatException,
UnsupportedCountryException {
BicUtil.validate(bic);
return new Bic(bic);
} | java | public static Bic valueOf(final String bic) throws BicFormatException,
UnsupportedCountryException {
BicUtil.validate(bic);
return new Bic(bic);
} | [
"public",
"static",
"Bic",
"valueOf",
"(",
"final",
"String",
"bic",
")",
"throws",
"BicFormatException",
",",
"UnsupportedCountryException",
"{",
"BicUtil",
".",
"validate",
"(",
"bic",
")",
";",
"return",
"new",
"Bic",
"(",
"bic",
")",
";",
"}"
] | Returns a Bic object holding the value of the specified String.
@param bic the String to be parsed.
@return a Bic object holding the value represented by the string argument.
@throws BicFormatException if the String doesn't contain parsable Bic.
UnsupportedCountryException if bic's country is not supported. | [
"Returns",
"a",
"Bic",
"object",
"holding",
"the",
"value",
"of",
"the",
"specified",
"String",
"."
] | 9889e8873c4ba5c34fc61d17594af935d2ca28a3 | https://github.com/arturmkrtchyan/iban4j/blob/9889e8873c4ba5c34fc61d17594af935d2ca28a3/src/main/java/org/iban4j/Bic.java#L40-L44 |
161,534 | arturmkrtchyan/iban4j | src/main/java/org/iban4j/BicUtil.java | BicUtil.validate | public static void validate(final String bic) throws BicFormatException,
UnsupportedCountryException {
try {
validateEmpty(bic);
validateLength(bic);
validateCase(bic);
validateBankCode(bic);
validateCountryCode(bic);
validateLo... | java | public static void validate(final String bic) throws BicFormatException,
UnsupportedCountryException {
try {
validateEmpty(bic);
validateLength(bic);
validateCase(bic);
validateBankCode(bic);
validateCountryCode(bic);
validateLo... | [
"public",
"static",
"void",
"validate",
"(",
"final",
"String",
"bic",
")",
"throws",
"BicFormatException",
",",
"UnsupportedCountryException",
"{",
"try",
"{",
"validateEmpty",
"(",
"bic",
")",
";",
"validateLength",
"(",
"bic",
")",
";",
"validateCase",
"(",
... | Validates bic.
@param bic to be validated.
@throws BicFormatException if bic is invalid.
UnsupportedCountryException if bic's country is not supported. | [
"Validates",
"bic",
"."
] | 9889e8873c4ba5c34fc61d17594af935d2ca28a3 | https://github.com/arturmkrtchyan/iban4j/blob/9889e8873c4ba5c34fc61d17594af935d2ca28a3/src/main/java/org/iban4j/BicUtil.java#L44-L62 |
161,535 | detro/ghostdriver | binding/java/src/main/java/org/openqa/selenium/phantomjs/PhantomJSDriver.java | PhantomJSDriver.getScreenshotAs | @Override
public <X> X getScreenshotAs(OutputType<X> target) {
// Get the screenshot as base64 and convert it to the requested type (i.e. OutputType<T>)
String base64 = (String) execute(DriverCommand.SCREENSHOT).getValue();
return target.convertFromBase64Png(base64);
} | java | @Override
public <X> X getScreenshotAs(OutputType<X> target) {
// Get the screenshot as base64 and convert it to the requested type (i.e. OutputType<T>)
String base64 = (String) execute(DriverCommand.SCREENSHOT).getValue();
return target.convertFromBase64Png(base64);
} | [
"@",
"Override",
"public",
"<",
"X",
">",
"X",
"getScreenshotAs",
"(",
"OutputType",
"<",
"X",
">",
"target",
")",
"{",
"// Get the screenshot as base64 and convert it to the requested type (i.e. OutputType<T>)",
"String",
"base64",
"=",
"(",
"String",
")",
"execute",
... | Take screenshot of the current window.
@param target The target type/format of the Screenshot
@return Screenshot of current window, in the requested format | [
"Take",
"screenshot",
"of",
"the",
"current",
"window",
"."
] | fe3063d52f47ec2781d43970452595c42f729ebf | https://github.com/detro/ghostdriver/blob/fe3063d52f47ec2781d43970452595c42f729ebf/binding/java/src/main/java/org/openqa/selenium/phantomjs/PhantomJSDriver.java#L134-L139 |
161,536 | notnoop/java-apns | src/main/java/com/notnoop/apns/PayloadBuilder.java | PayloadBuilder.sound | public PayloadBuilder sound(final String sound) {
if (sound != null) {
aps.put("sound", sound);
} else {
aps.remove("sound");
}
return this;
} | java | public PayloadBuilder sound(final String sound) {
if (sound != null) {
aps.put("sound", sound);
} else {
aps.remove("sound");
}
return this;
} | [
"public",
"PayloadBuilder",
"sound",
"(",
"final",
"String",
"sound",
")",
"{",
"if",
"(",
"sound",
"!=",
"null",
")",
"{",
"aps",
".",
"put",
"(",
"\"sound\"",
",",
"sound",
")",
";",
"}",
"else",
"{",
"aps",
".",
"remove",
"(",
"\"sound\"",
")",
... | Sets the alert sound to be played.
Passing {@code null} disables the notification sound.
@param sound the file name or song name to be played
when receiving the notification
@return this | [
"Sets",
"the",
"alert",
"sound",
"to",
"be",
"played",
"."
] | 180a190d4cb49458441596ca7c69d50ec7f1dba5 | https://github.com/notnoop/java-apns/blob/180a190d4cb49458441596ca7c69d50ec7f1dba5/src/main/java/com/notnoop/apns/PayloadBuilder.java#L153-L160 |
161,537 | notnoop/java-apns | src/main/java/com/notnoop/apns/PayloadBuilder.java | PayloadBuilder.category | public PayloadBuilder category(final String category) {
if (category != null) {
aps.put("category", category);
} else {
aps.remove("category");
}
return this;
} | java | public PayloadBuilder category(final String category) {
if (category != null) {
aps.put("category", category);
} else {
aps.remove("category");
}
return this;
} | [
"public",
"PayloadBuilder",
"category",
"(",
"final",
"String",
"category",
")",
"{",
"if",
"(",
"category",
"!=",
"null",
")",
"{",
"aps",
".",
"put",
"(",
"\"category\"",
",",
"category",
")",
";",
"}",
"else",
"{",
"aps",
".",
"remove",
"(",
"\"cate... | Sets the category of the notification for iOS8 notification
actions. See 13 minutes into "What's new in iOS Notifications"
Passing {@code null} removes the category.
@param category the name of the category supplied to the app
when receiving the notification
@return this | [
"Sets",
"the",
"category",
"of",
"the",
"notification",
"for",
"iOS8",
"notification",
"actions",
".",
"See",
"13",
"minutes",
"into",
"What",
"s",
"new",
"in",
"iOS",
"Notifications"
] | 180a190d4cb49458441596ca7c69d50ec7f1dba5 | https://github.com/notnoop/java-apns/blob/180a190d4cb49458441596ca7c69d50ec7f1dba5/src/main/java/com/notnoop/apns/PayloadBuilder.java#L172-L179 |
161,538 | notnoop/java-apns | src/main/java/com/notnoop/apns/PayloadBuilder.java | PayloadBuilder.customField | public PayloadBuilder customField(final String key, final Object value) {
root.put(key, value);
return this;
} | java | public PayloadBuilder customField(final String key, final Object value) {
root.put(key, value);
return this;
} | [
"public",
"PayloadBuilder",
"customField",
"(",
"final",
"String",
"key",
",",
"final",
"Object",
"value",
")",
"{",
"root",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Sets any application-specific custom fields. The values
are presented to the application and the iPhone doesn't
display them automatically.
This can be used to pass specific values (urls, ids, etc) to
the application in addition to the notification message
itself.
@param key the custom field name
@param value the ... | [
"Sets",
"any",
"application",
"-",
"specific",
"custom",
"fields",
".",
"The",
"values",
"are",
"presented",
"to",
"the",
"application",
"and",
"the",
"iPhone",
"doesn",
"t",
"display",
"them",
"automatically",
"."
] | 180a190d4cb49458441596ca7c69d50ec7f1dba5 | https://github.com/notnoop/java-apns/blob/180a190d4cb49458441596ca7c69d50ec7f1dba5/src/main/java/com/notnoop/apns/PayloadBuilder.java#L327-L330 |
161,539 | notnoop/java-apns | src/main/java/com/notnoop/apns/PayloadBuilder.java | PayloadBuilder.resizeAlertBody | public PayloadBuilder resizeAlertBody(final int payloadLength, final String postfix) {
int currLength = length();
if (currLength <= payloadLength) {
return this;
}
// now we are sure that truncation is required
String body = (String)customAlert.get("body");
... | java | public PayloadBuilder resizeAlertBody(final int payloadLength, final String postfix) {
int currLength = length();
if (currLength <= payloadLength) {
return this;
}
// now we are sure that truncation is required
String body = (String)customAlert.get("body");
... | [
"public",
"PayloadBuilder",
"resizeAlertBody",
"(",
"final",
"int",
"payloadLength",
",",
"final",
"String",
"postfix",
")",
"{",
"int",
"currLength",
"=",
"length",
"(",
")",
";",
"if",
"(",
"currLength",
"<=",
"payloadLength",
")",
"{",
"return",
"this",
"... | Shrinks the alert message body so that the resulting payload
message fits within the passed expected payload length.
This method performs best-effort approach, and its behavior
is unspecified when handling alerts where the payload
without body is already longer than the permitted size, or
if the break occurs within wo... | [
"Shrinks",
"the",
"alert",
"message",
"body",
"so",
"that",
"the",
"resulting",
"payload",
"message",
"fits",
"within",
"the",
"passed",
"expected",
"payload",
"length",
"."
] | 180a190d4cb49458441596ca7c69d50ec7f1dba5 | https://github.com/notnoop/java-apns/blob/180a190d4cb49458441596ca7c69d50ec7f1dba5/src/main/java/com/notnoop/apns/PayloadBuilder.java#L401-L428 |
161,540 | notnoop/java-apns | src/main/java/com/notnoop/apns/PayloadBuilder.java | PayloadBuilder.build | public String build() {
if (!root.containsKey("mdm")) {
insertCustomAlert();
root.put("aps", aps);
}
try {
return mapper.writeValueAsString(root);
} catch (final Exception e) {
throw new RuntimeException(e);
}
} | java | public String build() {
if (!root.containsKey("mdm")) {
insertCustomAlert();
root.put("aps", aps);
}
try {
return mapper.writeValueAsString(root);
} catch (final Exception e) {
throw new RuntimeException(e);
}
} | [
"public",
"String",
"build",
"(",
")",
"{",
"if",
"(",
"!",
"root",
".",
"containsKey",
"(",
"\"mdm\"",
")",
")",
"{",
"insertCustomAlert",
"(",
")",
";",
"root",
".",
"put",
"(",
"\"aps\"",
",",
"aps",
")",
";",
"}",
"try",
"{",
"return",
"mapper"... | Returns the JSON String representation of the payload
according to Apple APNS specification
@return the String representation as expected by Apple | [
"Returns",
"the",
"JSON",
"String",
"representation",
"of",
"the",
"payload",
"according",
"to",
"Apple",
"APNS",
"specification"
] | 180a190d4cb49458441596ca7c69d50ec7f1dba5 | https://github.com/notnoop/java-apns/blob/180a190d4cb49458441596ca7c69d50ec7f1dba5/src/main/java/com/notnoop/apns/PayloadBuilder.java#L468-L478 |
161,541 | notnoop/java-apns | src/main/java/com/notnoop/apns/ApnsServiceBuilder.java | ApnsServiceBuilder.withSocksProxy | public ApnsServiceBuilder withSocksProxy(String host, int port) {
Proxy proxy = new Proxy(Proxy.Type.SOCKS,
new InetSocketAddress(host, port));
return withProxy(proxy);
} | java | public ApnsServiceBuilder withSocksProxy(String host, int port) {
Proxy proxy = new Proxy(Proxy.Type.SOCKS,
new InetSocketAddress(host, port));
return withProxy(proxy);
} | [
"public",
"ApnsServiceBuilder",
"withSocksProxy",
"(",
"String",
"host",
",",
"int",
"port",
")",
"{",
"Proxy",
"proxy",
"=",
"new",
"Proxy",
"(",
"Proxy",
".",
"Type",
".",
"SOCKS",
",",
"new",
"InetSocketAddress",
"(",
"host",
",",
"port",
")",
")",
";... | Specify the address of the SOCKS proxy the connection should
use.
<p>Read the <a href="http://java.sun.com/javase/6/docs/technotes/guides/net/proxies.html">
Java Networking and Proxies</a> guide to understand the
proxies complexity.
<p>Be aware that this method only handles SOCKS proxies, not
HTTPS proxies. Use {@li... | [
"Specify",
"the",
"address",
"of",
"the",
"SOCKS",
"proxy",
"the",
"connection",
"should",
"use",
"."
] | 180a190d4cb49458441596ca7c69d50ec7f1dba5 | https://github.com/notnoop/java-apns/blob/180a190d4cb49458441596ca7c69d50ec7f1dba5/src/main/java/com/notnoop/apns/ApnsServiceBuilder.java#L469-L473 |
161,542 | notnoop/java-apns | src/main/java/com/notnoop/apns/ApnsServiceBuilder.java | ApnsServiceBuilder.withAuthProxy | public ApnsServiceBuilder withAuthProxy(Proxy proxy, String proxyUsername, String proxyPassword) {
this.proxy = proxy;
this.proxyUsername = proxyUsername;
this.proxyPassword = proxyPassword;
return this;
} | java | public ApnsServiceBuilder withAuthProxy(Proxy proxy, String proxyUsername, String proxyPassword) {
this.proxy = proxy;
this.proxyUsername = proxyUsername;
this.proxyPassword = proxyPassword;
return this;
} | [
"public",
"ApnsServiceBuilder",
"withAuthProxy",
"(",
"Proxy",
"proxy",
",",
"String",
"proxyUsername",
",",
"String",
"proxyPassword",
")",
"{",
"this",
".",
"proxy",
"=",
"proxy",
";",
"this",
".",
"proxyUsername",
"=",
"proxyUsername",
";",
"this",
".",
"pr... | Specify the proxy and the authentication parameters to be used
to establish the connections to Apple Servers.
<p>Read the <a href="http://java.sun.com/javase/6/docs/technotes/guides/net/proxies.html">
Java Networking and Proxies</a> guide to understand the
proxies complexity.
@param proxy the proxy object to be used ... | [
"Specify",
"the",
"proxy",
"and",
"the",
"authentication",
"parameters",
"to",
"be",
"used",
"to",
"establish",
"the",
"connections",
"to",
"Apple",
"Servers",
"."
] | 180a190d4cb49458441596ca7c69d50ec7f1dba5 | https://github.com/notnoop/java-apns/blob/180a190d4cb49458441596ca7c69d50ec7f1dba5/src/main/java/com/notnoop/apns/ApnsServiceBuilder.java#L488-L493 |
161,543 | notnoop/java-apns | src/main/java/com/notnoop/apns/ApnsServiceBuilder.java | ApnsServiceBuilder.withProxySocket | @Deprecated
public ApnsServiceBuilder withProxySocket(Socket proxySocket) {
return this.withProxy(new Proxy(Proxy.Type.SOCKS,
proxySocket.getRemoteSocketAddress()));
} | java | @Deprecated
public ApnsServiceBuilder withProxySocket(Socket proxySocket) {
return this.withProxy(new Proxy(Proxy.Type.SOCKS,
proxySocket.getRemoteSocketAddress()));
} | [
"@",
"Deprecated",
"public",
"ApnsServiceBuilder",
"withProxySocket",
"(",
"Socket",
"proxySocket",
")",
"{",
"return",
"this",
".",
"withProxy",
"(",
"new",
"Proxy",
"(",
"Proxy",
".",
"Type",
".",
"SOCKS",
",",
"proxySocket",
".",
"getRemoteSocketAddress",
"("... | Specify the socket to be used as underlying socket to connect
to the APN service.
This assumes that the socket connects to a SOCKS proxy.
@deprecated use {@link ApnsServiceBuilder#withProxy(Proxy)} instead
@param proxySocket the underlying socket for connections
@return this | [
"Specify",
"the",
"socket",
"to",
"be",
"used",
"as",
"underlying",
"socket",
"to",
"connect",
"to",
"the",
"APN",
"service",
"."
] | 180a190d4cb49458441596ca7c69d50ec7f1dba5 | https://github.com/notnoop/java-apns/blob/180a190d4cb49458441596ca7c69d50ec7f1dba5/src/main/java/com/notnoop/apns/ApnsServiceBuilder.java#L533-L537 |
161,544 | notnoop/java-apns | src/main/java/com/notnoop/apns/ApnsServiceBuilder.java | ApnsServiceBuilder.withDelegate | public ApnsServiceBuilder withDelegate(ApnsDelegate delegate) {
this.delegate = delegate == null ? ApnsDelegate.EMPTY : delegate;
return this;
} | java | public ApnsServiceBuilder withDelegate(ApnsDelegate delegate) {
this.delegate = delegate == null ? ApnsDelegate.EMPTY : delegate;
return this;
} | [
"public",
"ApnsServiceBuilder",
"withDelegate",
"(",
"ApnsDelegate",
"delegate",
")",
"{",
"this",
".",
"delegate",
"=",
"delegate",
"==",
"null",
"?",
"ApnsDelegate",
".",
"EMPTY",
":",
"delegate",
";",
"return",
"this",
";",
"}"
] | Sets the delegate of the service, that gets notified of the
status of message delivery.
Note: This option has no effect when using non-blocking
connections. | [
"Sets",
"the",
"delegate",
"of",
"the",
"service",
"that",
"gets",
"notified",
"of",
"the",
"status",
"of",
"message",
"delivery",
"."
] | 180a190d4cb49458441596ca7c69d50ec7f1dba5 | https://github.com/notnoop/java-apns/blob/180a190d4cb49458441596ca7c69d50ec7f1dba5/src/main/java/com/notnoop/apns/ApnsServiceBuilder.java#L679-L682 |
161,545 | notnoop/java-apns | src/main/java/com/notnoop/apns/SimpleApnsNotification.java | SimpleApnsNotification.length | public int length() {
int length = 1 + 2 + deviceToken.length + 2 + payload.length;
final int marshalledLength = marshall().length;
assert marshalledLength == length;
return length;
} | java | public int length() {
int length = 1 + 2 + deviceToken.length + 2 + payload.length;
final int marshalledLength = marshall().length;
assert marshalledLength == length;
return length;
} | [
"public",
"int",
"length",
"(",
")",
"{",
"int",
"length",
"=",
"1",
"+",
"2",
"+",
"deviceToken",
".",
"length",
"+",
"2",
"+",
"payload",
".",
"length",
";",
"final",
"int",
"marshalledLength",
"=",
"marshall",
"(",
")",
".",
"length",
";",
"assert... | Returns the length of the message in bytes as it is encoded on the wire.
Apple require the message to be of length 255 bytes or less.
@return length of encoded message in bytes | [
"Returns",
"the",
"length",
"of",
"the",
"message",
"in",
"bytes",
"as",
"it",
"is",
"encoded",
"on",
"the",
"wire",
"."
] | 180a190d4cb49458441596ca7c69d50ec7f1dba5 | https://github.com/notnoop/java-apns/blob/180a190d4cb49458441596ca7c69d50ec7f1dba5/src/main/java/com/notnoop/apns/SimpleApnsNotification.java#L124-L129 |
161,546 | Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/custom/MultiPageStack.java | MultiPageStack.setPadding | public void setPadding(float padding, Layout.Axis axis) {
OrientedLayout layout = null;
switch(axis) {
case X:
layout = mShiftLayout;
break;
case Y:
layout = mShiftLayout;
break;
case Z:
l... | java | public void setPadding(float padding, Layout.Axis axis) {
OrientedLayout layout = null;
switch(axis) {
case X:
layout = mShiftLayout;
break;
case Y:
layout = mShiftLayout;
break;
case Z:
l... | [
"public",
"void",
"setPadding",
"(",
"float",
"padding",
",",
"Layout",
".",
"Axis",
"axis",
")",
"{",
"OrientedLayout",
"layout",
"=",
"null",
";",
"switch",
"(",
"axis",
")",
"{",
"case",
"X",
":",
"layout",
"=",
"mShiftLayout",
";",
"break",
";",
"c... | Sets padding between the pages
@param padding
@param axis | [
"Sets",
"padding",
"between",
"the",
"pages"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/custom/MultiPageStack.java#L80-L103 |
161,547 | Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/custom/MultiPageStack.java | MultiPageStack.setShiftOrientation | public void setShiftOrientation(OrientedLayout.Orientation orientation) {
if (mShiftLayout.getOrientation() != orientation &&
orientation != OrientedLayout.Orientation.STACK) {
mShiftLayout.setOrientation(orientation);
requestLayout();
}
} | java | public void setShiftOrientation(OrientedLayout.Orientation orientation) {
if (mShiftLayout.getOrientation() != orientation &&
orientation != OrientedLayout.Orientation.STACK) {
mShiftLayout.setOrientation(orientation);
requestLayout();
}
} | [
"public",
"void",
"setShiftOrientation",
"(",
"OrientedLayout",
".",
"Orientation",
"orientation",
")",
"{",
"if",
"(",
"mShiftLayout",
".",
"getOrientation",
"(",
")",
"!=",
"orientation",
"&&",
"orientation",
"!=",
"OrientedLayout",
".",
"Orientation",
".",
"STA... | Sets page shift orientation. The pages might be shifted horizontally or vertically relative
to each other to make the content of each page on the screen at least partially visible
@param orientation | [
"Sets",
"page",
"shift",
"orientation",
".",
"The",
"pages",
"might",
"be",
"shifted",
"horizontally",
"or",
"vertically",
"relative",
"to",
"each",
"other",
"to",
"make",
"the",
"content",
"of",
"each",
"page",
"on",
"the",
"screen",
"at",
"least",
"partial... | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/custom/MultiPageStack.java#L110-L116 |
161,548 | Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/TouchManager.java | TouchManager.removeHandlerFor | public boolean removeHandlerFor(final GVRSceneObject sceneObject) {
sceneObject.detachComponent(GVRCollider.getComponentType());
return null != touchHandlers.remove(sceneObject);
} | java | public boolean removeHandlerFor(final GVRSceneObject sceneObject) {
sceneObject.detachComponent(GVRCollider.getComponentType());
return null != touchHandlers.remove(sceneObject);
} | [
"public",
"boolean",
"removeHandlerFor",
"(",
"final",
"GVRSceneObject",
"sceneObject",
")",
"{",
"sceneObject",
".",
"detachComponent",
"(",
"GVRCollider",
".",
"getComponentType",
"(",
")",
")",
";",
"return",
"null",
"!=",
"touchHandlers",
".",
"remove",
"(",
... | Makes the object unpickable and removes the touch handler for it
@param sceneObject
@return true if the handler has been successfully removed | [
"Makes",
"the",
"object",
"unpickable",
"and",
"removes",
"the",
"touch",
"handler",
"for",
"it"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/TouchManager.java#L93-L96 |
161,549 | Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/TouchManager.java | TouchManager.makePickable | public void makePickable(GVRSceneObject sceneObject) {
try {
GVRMeshCollider collider = new GVRMeshCollider(sceneObject.getGVRContext(), false);
sceneObject.attachComponent(collider);
} catch (Exception e) {
// Possible that some objects (X3D panel nodes) are without ... | java | public void makePickable(GVRSceneObject sceneObject) {
try {
GVRMeshCollider collider = new GVRMeshCollider(sceneObject.getGVRContext(), false);
sceneObject.attachComponent(collider);
} catch (Exception e) {
// Possible that some objects (X3D panel nodes) are without ... | [
"public",
"void",
"makePickable",
"(",
"GVRSceneObject",
"sceneObject",
")",
"{",
"try",
"{",
"GVRMeshCollider",
"collider",
"=",
"new",
"GVRMeshCollider",
"(",
"sceneObject",
".",
"getGVRContext",
"(",
")",
",",
"false",
")",
";",
"sceneObject",
".",
"attachCom... | Makes the scene object pickable by eyes. However, the object has to be touchable to process
the touch events.
@param sceneObject | [
"Makes",
"the",
"scene",
"object",
"pickable",
"by",
"eyes",
".",
"However",
"the",
"object",
"has",
"to",
"be",
"touchable",
"to",
"process",
"the",
"touch",
"events",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/TouchManager.java#L104-L112 |
161,550 | Samsung/GearVRf | GVRf/Extensions/3DCursor/IODevices/gearwear/GearWearIoDevice/src/main/java/com/gearvrf/io/gearwear/GearWearableUtility.java | GearWearableUtility.isInCircle | static boolean isInCircle(float x, float y, float centerX, float centerY, float
radius) {
return Math.abs(x - centerX) < radius && Math.abs(y - centerY) < radius;
} | java | static boolean isInCircle(float x, float y, float centerX, float centerY, float
radius) {
return Math.abs(x - centerX) < radius && Math.abs(y - centerY) < radius;
} | [
"static",
"boolean",
"isInCircle",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"centerX",
",",
"float",
"centerY",
",",
"float",
"radius",
")",
"{",
"return",
"Math",
".",
"abs",
"(",
"x",
"-",
"centerX",
")",
"<",
"radius",
"&&",
"Math",
"."... | Check if a position is within a circle
@param x x position
@param y y position
@param centerX center x of circle
@param centerY center y of circle
@return true if within circle, false otherwise | [
"Check",
"if",
"a",
"position",
"is",
"within",
"a",
"circle"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/3DCursor/IODevices/gearwear/GearWearIoDevice/src/main/java/com/gearvrf/io/gearwear/GearWearableUtility.java#L13-L16 |
161,551 | Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/animation/keyframe/GVRRotationKey.java | GVRRotationKey.setValue | public void setValue(Quaternionf rot) {
mX = rot.x;
mY = rot.y;
mZ = rot.z;
mW = rot.w;
} | java | public void setValue(Quaternionf rot) {
mX = rot.x;
mY = rot.y;
mZ = rot.z;
mW = rot.w;
} | [
"public",
"void",
"setValue",
"(",
"Quaternionf",
"rot",
")",
"{",
"mX",
"=",
"rot",
".",
"x",
";",
"mY",
"=",
"rot",
".",
"y",
";",
"mZ",
"=",
"rot",
".",
"z",
";",
"mW",
"=",
"rot",
".",
"w",
";",
"}"
] | Sets the quaternion of the keyframe. | [
"Sets",
"the",
"quaternion",
"of",
"the",
"keyframe",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/keyframe/GVRRotationKey.java#L44-L49 |
161,552 | Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRFloatImage.java | GVRFloatImage.update | public void update(int width, int height, float[] data)
throws IllegalArgumentException
{
if ((width <= 0) || (height <= 0) ||
(data == null) || (data.length < height * width * mFloatsPerPixel))
{
throw new IllegalArgumentException();
}
NativeFloat... | java | public void update(int width, int height, float[] data)
throws IllegalArgumentException
{
if ((width <= 0) || (height <= 0) ||
(data == null) || (data.length < height * width * mFloatsPerPixel))
{
throw new IllegalArgumentException();
}
NativeFloat... | [
"public",
"void",
"update",
"(",
"int",
"width",
",",
"int",
"height",
",",
"float",
"[",
"]",
"data",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"(",
"width",
"<=",
"0",
")",
"||",
"(",
"height",
"<=",
"0",
")",
"||",
"(",
"data",
... | Copy new data to an existing float-point texture.
Creating a new {@link GVRFloatImage} is pretty cheap, but it's still
not a totally trivial operation: it does involve some memory management
and some GL hardware handshaking. Reusing the texture reduces this
overhead (primarily by delaying garbage collection). Do be aw... | [
"Copy",
"new",
"data",
"to",
"an",
"existing",
"float",
"-",
"point",
"texture",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRFloatImage.java#L92-L101 |
161,553 | Samsung/GearVRf | GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/node/ImageTexture.java | ImageTexture.getUrl | public String[] getUrl() {
String[] valueDestination = new String[ url.size() ];
this.url.getValue(valueDestination);
return valueDestination;
} | java | public String[] getUrl() {
String[] valueDestination = new String[ url.size() ];
this.url.getValue(valueDestination);
return valueDestination;
} | [
"public",
"String",
"[",
"]",
"getUrl",
"(",
")",
"{",
"String",
"[",
"]",
"valueDestination",
"=",
"new",
"String",
"[",
"url",
".",
"size",
"(",
")",
"]",
";",
"this",
".",
"url",
".",
"getValue",
"(",
"valueDestination",
")",
";",
"return",
"value... | Provide array of String results from inputOutput MFString field named url.
@array saved in valueDestination | [
"Provide",
"array",
"of",
"String",
"results",
"from",
"inputOutput",
"MFString",
"field",
"named",
"url",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/node/ImageTexture.java#L68-L72 |
161,554 | Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/basic/ArchLayout.java | ArchLayout.getSizeArcLength | protected float getSizeArcLength(float angle) {
if (mRadius <= 0) {
throw new IllegalArgumentException("mRadius is not specified!");
}
return angle == Float.MAX_VALUE ? Float.MAX_VALUE :
LayoutHelpers.lengthOfArc(angle, mRadius);
} | java | protected float getSizeArcLength(float angle) {
if (mRadius <= 0) {
throw new IllegalArgumentException("mRadius is not specified!");
}
return angle == Float.MAX_VALUE ? Float.MAX_VALUE :
LayoutHelpers.lengthOfArc(angle, mRadius);
} | [
"protected",
"float",
"getSizeArcLength",
"(",
"float",
"angle",
")",
"{",
"if",
"(",
"mRadius",
"<=",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"mRadius is not specified!\"",
")",
";",
"}",
"return",
"angle",
"==",
"Float",
".",
"MAX_V... | Calculate the arc length by angle and radius
@param angle
@return arc length | [
"Calculate",
"the",
"arc",
"length",
"by",
"angle",
"and",
"radius"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/basic/ArchLayout.java#L114-L120 |
161,555 | Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/debug/GVRConsole.java | GVRConsole.writeLine | public void writeLine(String pattern, Object... parameters) {
String line = (parameters == null || parameters.length == 0) ? pattern
: String.format(pattern, parameters);
lines.add(0, line); // we'll write bottom to top, then purge unwritten
// lines from end
updateHUD();... | java | public void writeLine(String pattern, Object... parameters) {
String line = (parameters == null || parameters.length == 0) ? pattern
: String.format(pattern, parameters);
lines.add(0, line); // we'll write bottom to top, then purge unwritten
// lines from end
updateHUD();... | [
"public",
"void",
"writeLine",
"(",
"String",
"pattern",
",",
"Object",
"...",
"parameters",
")",
"{",
"String",
"line",
"=",
"(",
"parameters",
"==",
"null",
"||",
"parameters",
".",
"length",
"==",
"0",
")",
"?",
"pattern",
":",
"String",
".",
"format"... | Write a message to the console.
@param pattern
A {@link String#format(String, Object...)} pattern
@param parameters
Optional parameters to plug into the pattern | [
"Write",
"a",
"message",
"to",
"the",
"console",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/debug/GVRConsole.java#L178-L184 |
161,556 | Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/debug/GVRConsole.java | GVRConsole.setCanvasWidthHeight | public void setCanvasWidthHeight(int width, int height) {
hudWidth = width;
hudHeight = height;
HUD = Bitmap.createBitmap(width, height, Config.ARGB_8888);
canvas = new Canvas(HUD);
texture = null;
} | java | public void setCanvasWidthHeight(int width, int height) {
hudWidth = width;
hudHeight = height;
HUD = Bitmap.createBitmap(width, height, Config.ARGB_8888);
canvas = new Canvas(HUD);
texture = null;
} | [
"public",
"void",
"setCanvasWidthHeight",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"hudWidth",
"=",
"width",
";",
"hudHeight",
"=",
"height",
";",
"HUD",
"=",
"Bitmap",
".",
"createBitmap",
"(",
"width",
",",
"height",
",",
"Config",
".",
"AR... | Sets the width and height of the canvas the text is drawn to.
@param width
width of the new canvas.
@param height
hegiht of the new canvas. | [
"Sets",
"the",
"width",
"and",
"height",
"of",
"the",
"canvas",
"the",
"text",
"is",
"drawn",
"to",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/debug/GVRConsole.java#L336-L342 |
161,557 | Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/utility/MeshUtils.java | MeshUtils.scale | public static void scale(GVRMesh mesh, float x, float y, float z) {
final float [] vertices = mesh.getVertices();
final int vsize = vertices.length;
for (int i = 0; i < vsize; i += 3) {
vertices[i] *= x;
vertices[i + 1] *= y;
vertices[i + 2] *= z;
... | java | public static void scale(GVRMesh mesh, float x, float y, float z) {
final float [] vertices = mesh.getVertices();
final int vsize = vertices.length;
for (int i = 0; i < vsize; i += 3) {
vertices[i] *= x;
vertices[i + 1] *= y;
vertices[i + 2] *= z;
... | [
"public",
"static",
"void",
"scale",
"(",
"GVRMesh",
"mesh",
",",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"final",
"float",
"[",
"]",
"vertices",
"=",
"mesh",
".",
"getVertices",
"(",
")",
";",
"final",
"int",
"vsize",
"=",
"v... | Scale the mesh at x, y and z axis.
@param mesh Mesh to be scaled.
@param x Scale to be applied on x-axis.
@param y Scale to be applied on y-axis.
@param z Scale to be applied on z-axis. | [
"Scale",
"the",
"mesh",
"at",
"x",
"y",
"and",
"z",
"axis",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/utility/MeshUtils.java#L35-L46 |
161,558 | Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/utility/MeshUtils.java | MeshUtils.resize | public static void resize(GVRMesh mesh, float xsize, float ysize, float zsize) {
float dim[] = getBoundingSize(mesh);
scale(mesh, xsize / dim[0], ysize / dim[1], zsize / dim[2]);
} | java | public static void resize(GVRMesh mesh, float xsize, float ysize, float zsize) {
float dim[] = getBoundingSize(mesh);
scale(mesh, xsize / dim[0], ysize / dim[1], zsize / dim[2]);
} | [
"public",
"static",
"void",
"resize",
"(",
"GVRMesh",
"mesh",
",",
"float",
"xsize",
",",
"float",
"ysize",
",",
"float",
"zsize",
")",
"{",
"float",
"dim",
"[",
"]",
"=",
"getBoundingSize",
"(",
"mesh",
")",
";",
"scale",
"(",
"mesh",
",",
"xsize",
... | Resize the mesh to given size for each axis.
@param mesh Mesh to be resized.
@param xsize Size for x-axis.
@param ysize Size for y-axis.
@param zsize Size fof z-axis. | [
"Resize",
"the",
"mesh",
"to",
"given",
"size",
"for",
"each",
"axis",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/utility/MeshUtils.java#L66-L70 |
161,559 | Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/utility/MeshUtils.java | MeshUtils.resize | public static void resize(GVRMesh mesh, float size) {
float dim[] = getBoundingSize(mesh);
float maxsize = 0.0f;
if (dim[0] > maxsize) maxsize = dim[0];
if (dim[1] > maxsize) maxsize = dim[1];
if (dim[2] > maxsize) maxsize = dim[2];
scale(mesh, size / maxsize);
} | java | public static void resize(GVRMesh mesh, float size) {
float dim[] = getBoundingSize(mesh);
float maxsize = 0.0f;
if (dim[0] > maxsize) maxsize = dim[0];
if (dim[1] > maxsize) maxsize = dim[1];
if (dim[2] > maxsize) maxsize = dim[2];
scale(mesh, size / maxsize);
} | [
"public",
"static",
"void",
"resize",
"(",
"GVRMesh",
"mesh",
",",
"float",
"size",
")",
"{",
"float",
"dim",
"[",
"]",
"=",
"getBoundingSize",
"(",
"mesh",
")",
";",
"float",
"maxsize",
"=",
"0.0f",
";",
"if",
"(",
"dim",
"[",
"0",
"]",
">",
"maxs... | Resize the given mesh keeping its aspect ration.
@param mesh Mesh to be resized.
@param size Max size for the axis. | [
"Resize",
"the",
"given",
"mesh",
"keeping",
"its",
"aspect",
"ration",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/utility/MeshUtils.java#L77-L86 |
161,560 | Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/utility/MeshUtils.java | MeshUtils.getBoundingSize | public static float[] getBoundingSize(GVRMesh mesh) {
final float [] dim = new float[3];
final float [] vertices = mesh.getVertices();
final int vsize = vertices.length;
float minx = Integer.MAX_VALUE;
float miny = Integer.MAX_VALUE;
float minz = Integer.MAX_VALUE;
... | java | public static float[] getBoundingSize(GVRMesh mesh) {
final float [] dim = new float[3];
final float [] vertices = mesh.getVertices();
final int vsize = vertices.length;
float minx = Integer.MAX_VALUE;
float miny = Integer.MAX_VALUE;
float minz = Integer.MAX_VALUE;
... | [
"public",
"static",
"float",
"[",
"]",
"getBoundingSize",
"(",
"GVRMesh",
"mesh",
")",
"{",
"final",
"float",
"[",
"]",
"dim",
"=",
"new",
"float",
"[",
"3",
"]",
";",
"final",
"float",
"[",
"]",
"vertices",
"=",
"mesh",
".",
"getVertices",
"(",
")",... | Calcs the bonding size of given mesh.
@param mesh Mesh to calc its bouding size.
@return The bounding size for x, y and z axis. | [
"Calcs",
"the",
"bonding",
"size",
"of",
"given",
"mesh",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/utility/MeshUtils.java#L107-L134 |
161,561 | Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/utility/MeshUtils.java | MeshUtils.createQuad | public static GVRMesh createQuad(GVRContext gvrContext, float width, float height) {
GVRMesh mesh = new GVRMesh(gvrContext);
float[] vertices = { width * -0.5f, height * 0.5f, 0.0f, width * -0.5f,
height * -0.5f, 0.0f, width * 0.5f, height * 0.5f, 0.0f,
width * 0.5f, hei... | java | public static GVRMesh createQuad(GVRContext gvrContext, float width, float height) {
GVRMesh mesh = new GVRMesh(gvrContext);
float[] vertices = { width * -0.5f, height * 0.5f, 0.0f, width * -0.5f,
height * -0.5f, 0.0f, width * 0.5f, height * 0.5f, 0.0f,
width * 0.5f, hei... | [
"public",
"static",
"GVRMesh",
"createQuad",
"(",
"GVRContext",
"gvrContext",
",",
"float",
"width",
",",
"float",
"height",
")",
"{",
"GVRMesh",
"mesh",
"=",
"new",
"GVRMesh",
"(",
"gvrContext",
")",
";",
"float",
"[",
"]",
"vertices",
"=",
"{",
"width",
... | Creates a quad consisting of two triangles, with the specified width and
height.
@param gvrContext current {@link GVRContext}
@param width
the quad's width
@param height
the quad's height
@return A 2D, rectangular mesh with four vertices and two triangles | [
"Creates",
"a",
"quad",
"consisting",
"of",
"two",
"triangles",
"with",
"the",
"specified",
"width",
"and",
"height",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/utility/MeshUtils.java#L148-L168 |
161,562 | Samsung/GearVRf | GVRf/Framework/backend_oculus/src/main/java/org/gearvrf/OvrViewManager.java | OvrViewManager.onSurfaceChanged | void onSurfaceChanged(int width, int height) {
Log.v(TAG, "onSurfaceChanged");
final VrAppSettings.EyeBufferParams.DepthFormat depthFormat = mApplication.getAppSettings().getEyeBufferParams().getDepthFormat();
mApplication.getConfigurationManager().configureRendering(VrAppSettings.EyeBufferPara... | java | void onSurfaceChanged(int width, int height) {
Log.v(TAG, "onSurfaceChanged");
final VrAppSettings.EyeBufferParams.DepthFormat depthFormat = mApplication.getAppSettings().getEyeBufferParams().getDepthFormat();
mApplication.getConfigurationManager().configureRendering(VrAppSettings.EyeBufferPara... | [
"void",
"onSurfaceChanged",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"Log",
".",
"v",
"(",
"TAG",
",",
"\"onSurfaceChanged\"",
")",
";",
"final",
"VrAppSettings",
".",
"EyeBufferParams",
".",
"DepthFormat",
"depthFormat",
"=",
"mApplication",
".",
... | Called when the surface is created or recreated. Avoided because this can
be called twice at the beginning. | [
"Called",
"when",
"the",
"surface",
"is",
"created",
"or",
"recreated",
".",
"Avoided",
"because",
"this",
"can",
"be",
"called",
"twice",
"at",
"the",
"beginning",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/backend_oculus/src/main/java/org/gearvrf/OvrViewManager.java#L145-L150 |
161,563 | Samsung/GearVRf | GVRf/Framework/backend_oculus/src/main/java/org/gearvrf/OvrViewManager.java | OvrViewManager.onDrawEye | void onDrawEye(int eye, int swapChainIndex, boolean use_multiview) {
mCurrentEye = eye;
if (!(mSensoredScene == null || !mMainScene.equals(mSensoredScene))) {
GVRCameraRig mainCameraRig = mMainScene.getMainCameraRig();
if (use_multiview) {
if (DEBUG_STATS) {
... | java | void onDrawEye(int eye, int swapChainIndex, boolean use_multiview) {
mCurrentEye = eye;
if (!(mSensoredScene == null || !mMainScene.equals(mSensoredScene))) {
GVRCameraRig mainCameraRig = mMainScene.getMainCameraRig();
if (use_multiview) {
if (DEBUG_STATS) {
... | [
"void",
"onDrawEye",
"(",
"int",
"eye",
",",
"int",
"swapChainIndex",
",",
"boolean",
"use_multiview",
")",
"{",
"mCurrentEye",
"=",
"eye",
";",
"if",
"(",
"!",
"(",
"mSensoredScene",
"==",
"null",
"||",
"!",
"mMainScene",
".",
"equals",
"(",
"mSensoredSce... | Called from the native side
@param eye | [
"Called",
"from",
"the",
"native",
"side"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/backend_oculus/src/main/java/org/gearvrf/OvrViewManager.java#L174-L249 |
161,564 | Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRResourceVolume.java | GVRResourceVolume.openResource | public GVRAndroidResource openResource(String filePath) throws IOException {
// Error tolerance: Remove initial '/' introduced by file::///filename
// In this case, the path is interpreted as relative to defaultPath,
// which is the root of the filesystem.
if (filePath.startsWith(File.se... | java | public GVRAndroidResource openResource(String filePath) throws IOException {
// Error tolerance: Remove initial '/' introduced by file::///filename
// In this case, the path is interpreted as relative to defaultPath,
// which is the root of the filesystem.
if (filePath.startsWith(File.se... | [
"public",
"GVRAndroidResource",
"openResource",
"(",
"String",
"filePath",
")",
"throws",
"IOException",
"{",
"// Error tolerance: Remove initial '/' introduced by file::///filename",
"// In this case, the path is interpreted as relative to defaultPath,",
"// which is the root of the filesys... | Opens a file from the volume. The filePath is relative to the
defaultPath.
@param filePath
File path of the resource to open.
@throws IOException | [
"Opens",
"a",
"file",
"from",
"the",
"volume",
".",
"The",
"filePath",
"is",
"relative",
"to",
"the",
"defaultPath",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRResourceVolume.java#L281-L340 |
161,565 | Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRResourceVolume.java | GVRResourceVolume.adaptFilePath | protected String adaptFilePath(String filePath) {
// Convert windows file path to target FS
String targetPath = filePath.replaceAll("\\\\", volumeType.getSeparator());
return targetPath;
} | java | protected String adaptFilePath(String filePath) {
// Convert windows file path to target FS
String targetPath = filePath.replaceAll("\\\\", volumeType.getSeparator());
return targetPath;
} | [
"protected",
"String",
"adaptFilePath",
"(",
"String",
"filePath",
")",
"{",
"// Convert windows file path to target FS",
"String",
"targetPath",
"=",
"filePath",
".",
"replaceAll",
"(",
"\"\\\\\\\\\"",
",",
"volumeType",
".",
"getSeparator",
"(",
")",
")",
";",
"re... | Adapt a file path to the current file system.
@param filePath The input file path string.
@return File path compatible with the file system of this {@link GVRResourceVolume}. | [
"Adapt",
"a",
"file",
"path",
"to",
"the",
"current",
"file",
"system",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRResourceVolume.java#L357-L362 |
161,566 | Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java | GVRVertexBuffer.getFloatVec | public FloatBuffer getFloatVec(String attributeName)
{
int size = getAttributeSize(attributeName);
if (size <= 0)
{
return null;
}
size *= 4 * getVertexCount();
ByteBuffer buffer = ByteBuffer.allocateDirect(size).order(ByteOrder.nativeOrder());
Flo... | java | public FloatBuffer getFloatVec(String attributeName)
{
int size = getAttributeSize(attributeName);
if (size <= 0)
{
return null;
}
size *= 4 * getVertexCount();
ByteBuffer buffer = ByteBuffer.allocateDirect(size).order(ByteOrder.nativeOrder());
Flo... | [
"public",
"FloatBuffer",
"getFloatVec",
"(",
"String",
"attributeName",
")",
"{",
"int",
"size",
"=",
"getAttributeSize",
"(",
"attributeName",
")",
";",
"if",
"(",
"size",
"<=",
"0",
")",
"{",
"return",
"null",
";",
"}",
"size",
"*=",
"4",
"*",
"getVert... | Retrieves a vertex attribute as a float buffer.
The attribute name must be one of the
attributes named in the descriptor passed to the constructor.
@param attributeName name of the attribute to update
@throws IllegalArgumentException if attribute name not in descriptor vertex attribute is not <i>float</i>
@see #setFloa... | [
"Retrieves",
"a",
"vertex",
"attribute",
"as",
"a",
"float",
"buffer",
".",
"The",
"attribute",
"name",
"must",
"be",
"one",
"of",
"the",
"attributes",
"named",
"in",
"the",
"descriptor",
"passed",
"to",
"the",
"constructor",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java#L152-L167 |
161,567 | Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java | GVRVertexBuffer.getFloatArray | public float[] getFloatArray(String attributeName)
{
float[] array = NativeVertexBuffer.getFloatArray(getNative(), attributeName);
if (array == null)
{
throw new IllegalArgumentException("Attribute name " + attributeName + " cannot be accessed");
}
return array;
... | java | public float[] getFloatArray(String attributeName)
{
float[] array = NativeVertexBuffer.getFloatArray(getNative(), attributeName);
if (array == null)
{
throw new IllegalArgumentException("Attribute name " + attributeName + " cannot be accessed");
}
return array;
... | [
"public",
"float",
"[",
"]",
"getFloatArray",
"(",
"String",
"attributeName",
")",
"{",
"float",
"[",
"]",
"array",
"=",
"NativeVertexBuffer",
".",
"getFloatArray",
"(",
"getNative",
"(",
")",
",",
"attributeName",
")",
";",
"if",
"(",
"array",
"==",
"null... | Retrieves a vertex attribute as a float array.
The attribute name must be one of the
attributes named in the descriptor passed to the constructor.
@param attributeName name of the attribute to update
@throws IllegalArgumentException if attribute name not in descriptor vertex attribute is not <i>float</i>
@see #setFloat... | [
"Retrieves",
"a",
"vertex",
"attribute",
"as",
"a",
"float",
"array",
".",
"The",
"attribute",
"name",
"must",
"be",
"one",
"of",
"the",
"attributes",
"named",
"in",
"the",
"descriptor",
"passed",
"to",
"the",
"constructor",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java#L178-L186 |
161,568 | Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java | GVRVertexBuffer.getIntVec | public IntBuffer getIntVec(String attributeName)
{
int size = getAttributeSize(attributeName);
if (size <= 0)
{
return null;
}
size *= 4 * getVertexCount();
ByteBuffer buffer = ByteBuffer.allocateDirect(size).order(ByteOrder.nativeOrder());
IntBuff... | java | public IntBuffer getIntVec(String attributeName)
{
int size = getAttributeSize(attributeName);
if (size <= 0)
{
return null;
}
size *= 4 * getVertexCount();
ByteBuffer buffer = ByteBuffer.allocateDirect(size).order(ByteOrder.nativeOrder());
IntBuff... | [
"public",
"IntBuffer",
"getIntVec",
"(",
"String",
"attributeName",
")",
"{",
"int",
"size",
"=",
"getAttributeSize",
"(",
"attributeName",
")",
";",
"if",
"(",
"size",
"<=",
"0",
")",
"{",
"return",
"null",
";",
"}",
"size",
"*=",
"4",
"*",
"getVertexCo... | Retrieves a vertex attribute as an integer buffer.
The attribute name must be one of the
attributes named in the descriptor passed to the constructor.
@param attributeName name of the attribute to update
@throws IllegalArgumentException if attribute name not in descriptor vertex attribute is not <i>int</i>
@see #setInt... | [
"Retrieves",
"a",
"vertex",
"attribute",
"as",
"an",
"integer",
"buffer",
".",
"The",
"attribute",
"name",
"must",
"be",
"one",
"of",
"the",
"attributes",
"named",
"in",
"the",
"descriptor",
"passed",
"to",
"the",
"constructor",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java#L197-L212 |
161,569 | Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java | GVRVertexBuffer.getIntArray | public int[] getIntArray(String attributeName)
{
int[] array = NativeVertexBuffer.getIntArray(getNative(), attributeName);
if (array == null)
{
throw new IllegalArgumentException("Attribute name " + attributeName + " cannot be accessed");
}
return array;
} | java | public int[] getIntArray(String attributeName)
{
int[] array = NativeVertexBuffer.getIntArray(getNative(), attributeName);
if (array == null)
{
throw new IllegalArgumentException("Attribute name " + attributeName + " cannot be accessed");
}
return array;
} | [
"public",
"int",
"[",
"]",
"getIntArray",
"(",
"String",
"attributeName",
")",
"{",
"int",
"[",
"]",
"array",
"=",
"NativeVertexBuffer",
".",
"getIntArray",
"(",
"getNative",
"(",
")",
",",
"attributeName",
")",
";",
"if",
"(",
"array",
"==",
"null",
")"... | Retrieves a vertex attribute as an integer array.
The attribute name must be one of the
attributes named in the descriptor passed to the constructor.
@param attributeName name of the attribute to update
@throws IllegalArgumentException if attribute name not in descriptor vertex attribute is not <i>int</i>
@see #setIntV... | [
"Retrieves",
"a",
"vertex",
"attribute",
"as",
"an",
"integer",
"array",
".",
"The",
"attribute",
"name",
"must",
"be",
"one",
"of",
"the",
"attributes",
"named",
"in",
"the",
"descriptor",
"passed",
"to",
"the",
"constructor",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java#L223-L231 |
161,570 | Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java | GVRVertexBuffer.getSphereBound | public float getSphereBound(float[] sphere)
{
if ((sphere == null) || (sphere.length != 4) ||
((NativeVertexBuffer.getBoundingVolume(getNative(), sphere)) < 0))
{
throw new IllegalArgumentException("Cannot copy sphere bound into array provided");
}
return sphe... | java | public float getSphereBound(float[] sphere)
{
if ((sphere == null) || (sphere.length != 4) ||
((NativeVertexBuffer.getBoundingVolume(getNative(), sphere)) < 0))
{
throw new IllegalArgumentException("Cannot copy sphere bound into array provided");
}
return sphe... | [
"public",
"float",
"getSphereBound",
"(",
"float",
"[",
"]",
"sphere",
")",
"{",
"if",
"(",
"(",
"sphere",
"==",
"null",
")",
"||",
"(",
"sphere",
".",
"length",
"!=",
"4",
")",
"||",
"(",
"(",
"NativeVertexBuffer",
".",
"getBoundingVolume",
"(",
"getN... | Returns the bounding sphere of the vertices.
@param sphere destination array to get bounding sphere.
The first entry is the radius, the next
three are the center.
@return radius of bounding sphere or 0.0 if no vertices | [
"Returns",
"the",
"bounding",
"sphere",
"of",
"the",
"vertices",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java#L551-L559 |
161,571 | Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java | GVRVertexBuffer.getBoxBound | public boolean getBoxBound(float[] corners)
{
int rc;
if ((corners == null) || (corners.length != 6) ||
((rc = NativeVertexBuffer.getBoundingVolume(getNative(), corners)) < 0))
{
throw new IllegalArgumentException("Cannot copy box bound into array provided");
... | java | public boolean getBoxBound(float[] corners)
{
int rc;
if ((corners == null) || (corners.length != 6) ||
((rc = NativeVertexBuffer.getBoundingVolume(getNative(), corners)) < 0))
{
throw new IllegalArgumentException("Cannot copy box bound into array provided");
... | [
"public",
"boolean",
"getBoxBound",
"(",
"float",
"[",
"]",
"corners",
")",
"{",
"int",
"rc",
";",
"if",
"(",
"(",
"corners",
"==",
"null",
")",
"||",
"(",
"corners",
".",
"length",
"!=",
"6",
")",
"||",
"(",
"(",
"rc",
"=",
"NativeVertexBuffer",
"... | Returns the bounding box of the vertices.
@param corners destination array to get corners of bounding box.
The first three entries are the minimum X,Y,Z values
and the next three are the maximum X,Y,Z.
@return true if bounds are not empty, false if empty (no vertices) | [
"Returns",
"the",
"bounding",
"box",
"of",
"the",
"vertices",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java#L568-L577 |
161,572 | Samsung/GearVRf | GVRf/Extensions/ResonanceAudio/resonanceaudio/src/main/java/org/gearvrf/resonanceaudio/GVRAudioSource.java | GVRAudioSource.load | public void load(String soundFile)
{
if (mSoundFile != null)
{
unload();
}
mSoundFile = soundFile;
if (mAudioListener != null)
{
mAudioListener.getAudioEngine().preloadSoundFile(soundFile);
Log.d("SOUND", "loaded audio file %s", get... | java | public void load(String soundFile)
{
if (mSoundFile != null)
{
unload();
}
mSoundFile = soundFile;
if (mAudioListener != null)
{
mAudioListener.getAudioEngine().preloadSoundFile(soundFile);
Log.d("SOUND", "loaded audio file %s", get... | [
"public",
"void",
"load",
"(",
"String",
"soundFile",
")",
"{",
"if",
"(",
"mSoundFile",
"!=",
"null",
")",
"{",
"unload",
"(",
")",
";",
"}",
"mSoundFile",
"=",
"soundFile",
";",
"if",
"(",
"mAudioListener",
"!=",
"null",
")",
"{",
"mAudioListener",
"... | Preloads a sound file.
@param soundFile path/name of the file to be played. | [
"Preloads",
"a",
"sound",
"file",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/ResonanceAudio/resonanceaudio/src/main/java/org/gearvrf/resonanceaudio/GVRAudioSource.java#L85-L97 |
161,573 | Samsung/GearVRf | GVRf/Extensions/ResonanceAudio/resonanceaudio/src/main/java/org/gearvrf/resonanceaudio/GVRAudioSource.java | GVRAudioSource.unload | public void unload()
{
if (mAudioListener != null)
{
Log.d("SOUND", "unloading audio source %d %s", getSourceId(), getSoundFile());
mAudioListener.getAudioEngine().unloadSoundFile(getSoundFile());
}
mSoundFile = null;
mSourceId = GvrAudioEngine.INVALID... | java | public void unload()
{
if (mAudioListener != null)
{
Log.d("SOUND", "unloading audio source %d %s", getSourceId(), getSoundFile());
mAudioListener.getAudioEngine().unloadSoundFile(getSoundFile());
}
mSoundFile = null;
mSourceId = GvrAudioEngine.INVALID... | [
"public",
"void",
"unload",
"(",
")",
"{",
"if",
"(",
"mAudioListener",
"!=",
"null",
")",
"{",
"Log",
".",
"d",
"(",
"\"SOUND\"",
",",
"\"unloading audio source %d %s\"",
",",
"getSourceId",
"(",
")",
",",
"getSoundFile",
"(",
")",
")",
";",
"mAudioListen... | Unloads the sound file for this source, if any. | [
"Unloads",
"the",
"sound",
"file",
"for",
"this",
"source",
"if",
"any",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/ResonanceAudio/resonanceaudio/src/main/java/org/gearvrf/resonanceaudio/GVRAudioSource.java#L102-L111 |
161,574 | Samsung/GearVRf | GVRf/Extensions/ResonanceAudio/resonanceaudio/src/main/java/org/gearvrf/resonanceaudio/GVRAudioSource.java | GVRAudioSource.pause | public void pause()
{
if (mAudioListener != null)
{
int sourceId = getSourceId();
if (sourceId != GvrAudioEngine.INVALID_ID)
{
mAudioListener.getAudioEngine().pauseSound(sourceId);
}
}
} | java | public void pause()
{
if (mAudioListener != null)
{
int sourceId = getSourceId();
if (sourceId != GvrAudioEngine.INVALID_ID)
{
mAudioListener.getAudioEngine().pauseSound(sourceId);
}
}
} | [
"public",
"void",
"pause",
"(",
")",
"{",
"if",
"(",
"mAudioListener",
"!=",
"null",
")",
"{",
"int",
"sourceId",
"=",
"getSourceId",
"(",
")",
";",
"if",
"(",
"sourceId",
"!=",
"GvrAudioEngine",
".",
"INVALID_ID",
")",
"{",
"mAudioListener",
".",
"getAu... | Pauses the playback of a sound. | [
"Pauses",
"the",
"playback",
"of",
"a",
"sound",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/ResonanceAudio/resonanceaudio/src/main/java/org/gearvrf/resonanceaudio/GVRAudioSource.java#L225-L235 |
161,575 | Samsung/GearVRf | GVRf/Extensions/ResonanceAudio/resonanceaudio/src/main/java/org/gearvrf/resonanceaudio/GVRAudioSource.java | GVRAudioSource.stop | public void stop()
{
if (mAudioListener != null)
{
Log.d("SOUND", "stopping audio source %d %s", getSourceId(), getSoundFile());
mAudioListener.getAudioEngine().stopSound(getSourceId());
}
} | java | public void stop()
{
if (mAudioListener != null)
{
Log.d("SOUND", "stopping audio source %d %s", getSourceId(), getSoundFile());
mAudioListener.getAudioEngine().stopSound(getSourceId());
}
} | [
"public",
"void",
"stop",
"(",
")",
"{",
"if",
"(",
"mAudioListener",
"!=",
"null",
")",
"{",
"Log",
".",
"d",
"(",
"\"SOUND\"",
",",
"\"stopping audio source %d %s\"",
",",
"getSourceId",
"(",
")",
",",
"getSoundFile",
"(",
")",
")",
";",
"mAudioListener"... | Stops the playback of a sound and destroys the corresponding Sound Object or Soundfield. | [
"Stops",
"the",
"playback",
"of",
"a",
"sound",
"and",
"destroys",
"the",
"corresponding",
"Sound",
"Object",
"or",
"Soundfield",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/ResonanceAudio/resonanceaudio/src/main/java/org/gearvrf/resonanceaudio/GVRAudioSource.java#L263-L270 |
161,576 | Samsung/GearVRf | GVRf/Extensions/ResonanceAudio/resonanceaudio/src/main/java/org/gearvrf/resonanceaudio/GVRAudioSource.java | GVRAudioSource.setVolume | public void setVolume(float volume)
{
// Save this in case this audio source is not being played yet
mVolume = volume;
if (isPlaying() && (getSourceId() != GvrAudioEngine.INVALID_ID))
{
// This will actually work only if the sound file is being played
mAudioLi... | java | public void setVolume(float volume)
{
// Save this in case this audio source is not being played yet
mVolume = volume;
if (isPlaying() && (getSourceId() != GvrAudioEngine.INVALID_ID))
{
// This will actually work only if the sound file is being played
mAudioLi... | [
"public",
"void",
"setVolume",
"(",
"float",
"volume",
")",
"{",
"// Save this in case this audio source is not being played yet",
"mVolume",
"=",
"volume",
";",
"if",
"(",
"isPlaying",
"(",
")",
"&&",
"(",
"getSourceId",
"(",
")",
"!=",
"GvrAudioEngine",
".",
"IN... | Changes the volume of an existing sound.
@param volume volume value. Should range from 0 (mute) to 1 (max) | [
"Changes",
"the",
"volume",
"of",
"an",
"existing",
"sound",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/ResonanceAudio/resonanceaudio/src/main/java/org/gearvrf/resonanceaudio/GVRAudioSource.java#L276-L285 |
161,577 | Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Vector3Axis.java | Vector3Axis.get | public float get(Layout.Axis axis) {
switch (axis) {
case X:
return x;
case Y:
return y;
case Z:
return z;
default:
throw new RuntimeAssertion("Bad axis specified: %s", axis);
}
} | java | public float get(Layout.Axis axis) {
switch (axis) {
case X:
return x;
case Y:
return y;
case Z:
return z;
default:
throw new RuntimeAssertion("Bad axis specified: %s", axis);
}
} | [
"public",
"float",
"get",
"(",
"Layout",
".",
"Axis",
"axis",
")",
"{",
"switch",
"(",
"axis",
")",
"{",
"case",
"X",
":",
"return",
"x",
";",
"case",
"Y",
":",
"return",
"y",
";",
"case",
"Z",
":",
"return",
"z",
";",
"default",
":",
"throw",
... | Gets axis dimension
@param axis Axis. It might be either {@link Layout.Axis#X X} or
{@link Layout.Axis#Y Y} or {@link Layout.Axis#Z Z}
@return axis dimension | [
"Gets",
"axis",
"dimension"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Vector3Axis.java#L45-L56 |
161,578 | Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Vector3Axis.java | Vector3Axis.set | public void set(float val, Layout.Axis axis) {
switch (axis) {
case X:
x = val;
break;
case Y:
y = val;
break;
case Z:
z = val;
break;
default:
throw ne... | java | public void set(float val, Layout.Axis axis) {
switch (axis) {
case X:
x = val;
break;
case Y:
y = val;
break;
case Z:
z = val;
break;
default:
throw ne... | [
"public",
"void",
"set",
"(",
"float",
"val",
",",
"Layout",
".",
"Axis",
"axis",
")",
"{",
"switch",
"(",
"axis",
")",
"{",
"case",
"X",
":",
"x",
"=",
"val",
";",
"break",
";",
"case",
"Y",
":",
"y",
"=",
"val",
";",
"break",
";",
"case",
"... | Sets axis dimension
@param val dimension
@param axis Axis. It might be either {@link Layout.Axis#X X} or
{@link Layout.Axis#Y Y} or {@link Layout.Axis#Z Z} | [
"Sets",
"axis",
"dimension"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Vector3Axis.java#L64-L78 |
161,579 | Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Vector3Axis.java | Vector3Axis.delta | public Vector3Axis delta(Vector3f v) {
Vector3Axis ret = new Vector3Axis(Float.NaN, Float.NaN, Float.NaN);
if (x != Float.NaN && v.x != Float.NaN && !equal(x, v.x)) {
ret.set(x - v.x, Layout.Axis.X);
}
if (y != Float.NaN && v.y != Float.NaN && !equal(y, v.y)) {
re... | java | public Vector3Axis delta(Vector3f v) {
Vector3Axis ret = new Vector3Axis(Float.NaN, Float.NaN, Float.NaN);
if (x != Float.NaN && v.x != Float.NaN && !equal(x, v.x)) {
ret.set(x - v.x, Layout.Axis.X);
}
if (y != Float.NaN && v.y != Float.NaN && !equal(y, v.y)) {
re... | [
"public",
"Vector3Axis",
"delta",
"(",
"Vector3f",
"v",
")",
"{",
"Vector3Axis",
"ret",
"=",
"new",
"Vector3Axis",
"(",
"Float",
".",
"NaN",
",",
"Float",
".",
"NaN",
",",
"Float",
".",
"NaN",
")",
";",
"if",
"(",
"x",
"!=",
"Float",
".",
"NaN",
"&... | Calculate delta with another vector
@param v another vector
@return delta vector | [
"Calculate",
"delta",
"with",
"another",
"vector"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Vector3Axis.java#L101-L113 |
161,580 | Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/custom/PageIndicatorWidget.java | PageIndicatorWidget.setPageCount | public int setPageCount(final int num) {
int diff = num - getCheckableCount();
if (diff > 0) {
addIndicatorChildren(diff);
} else if (diff < 0) {
removeIndicatorChildren(-diff);
}
if (mCurrentPage >=num ) {
mCurrentPage = 0;
}
s... | java | public int setPageCount(final int num) {
int diff = num - getCheckableCount();
if (diff > 0) {
addIndicatorChildren(diff);
} else if (diff < 0) {
removeIndicatorChildren(-diff);
}
if (mCurrentPage >=num ) {
mCurrentPage = 0;
}
s... | [
"public",
"int",
"setPageCount",
"(",
"final",
"int",
"num",
")",
"{",
"int",
"diff",
"=",
"num",
"-",
"getCheckableCount",
"(",
")",
";",
"if",
"(",
"diff",
">",
"0",
")",
"{",
"addIndicatorChildren",
"(",
"diff",
")",
";",
"}",
"else",
"if",
"(",
... | Sets number of pages. If the index of currently selected page is bigger than the total number
of pages, first page will be selected instead.
@return difference between the previous number of pages and new one. Negative value is
returned if new number of pages is less then it was before. | [
"Sets",
"number",
"of",
"pages",
".",
"If",
"the",
"index",
"of",
"currently",
"selected",
"page",
"is",
"bigger",
"than",
"the",
"total",
"number",
"of",
"pages",
"first",
"page",
"will",
"be",
"selected",
"instead",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/custom/PageIndicatorWidget.java#L122-L134 |
161,581 | Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/custom/PageIndicatorWidget.java | PageIndicatorWidget.setCurrentPage | public boolean setCurrentPage(final int page) {
Log.d(TAG, "setPageId pageId = %d", page);
return (page >= 0 && page < getCheckableCount()) && check(page);
} | java | public boolean setCurrentPage(final int page) {
Log.d(TAG, "setPageId pageId = %d", page);
return (page >= 0 && page < getCheckableCount()) && check(page);
} | [
"public",
"boolean",
"setCurrentPage",
"(",
"final",
"int",
"page",
")",
"{",
"Log",
".",
"d",
"(",
"TAG",
",",
"\"setPageId pageId = %d\"",
",",
"page",
")",
";",
"return",
"(",
"page",
">=",
"0",
"&&",
"page",
"<",
"getCheckableCount",
"(",
")",
")",
... | Sets selected page implicitly
@param page new selected page
@return true if the page has been selected successfully | [
"Sets",
"selected",
"page",
"implicitly"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/custom/PageIndicatorWidget.java#L149-L152 |
161,582 | Samsung/GearVRf | GVRf/Extensions/gvrf-physics/src/main/java/org/gearvrf/physics/GVRPhysicsAvatar.java | GVRPhysicsAvatar.loadPhysics | public void loadPhysics(String filename, GVRScene scene) throws IOException
{
GVRPhysicsLoader.loadPhysicsFile(getGVRContext(), filename, true, scene);
} | java | public void loadPhysics(String filename, GVRScene scene) throws IOException
{
GVRPhysicsLoader.loadPhysicsFile(getGVRContext(), filename, true, scene);
} | [
"public",
"void",
"loadPhysics",
"(",
"String",
"filename",
",",
"GVRScene",
"scene",
")",
"throws",
"IOException",
"{",
"GVRPhysicsLoader",
".",
"loadPhysicsFile",
"(",
"getGVRContext",
"(",
")",
",",
"filename",
",",
"true",
",",
"scene",
")",
";",
"}"
] | Load physics information for the current avatar
@param filename name of physics file
@param scene scene the avatar is part of
@throws IOException if physics file cannot be parsed | [
"Load",
"physics",
"information",
"for",
"the",
"current",
"avatar"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/gvrf-physics/src/main/java/org/gearvrf/physics/GVRPhysicsAvatar.java#L62-L65 |
161,583 | Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/MainScene.java | MainScene.rotateToFaceCamera | public void rotateToFaceCamera(final GVRTransform transform) {
//see http://stackoverflow.com/questions/5782658/extracting-yaw-from-a-quaternion
final GVRTransform t = getMainCameraRig().getHeadTransform();
final Quaternionf q = new Quaternionf(0, t.getRotationY(), 0, t.getRotationW()).normalize... | java | public void rotateToFaceCamera(final GVRTransform transform) {
//see http://stackoverflow.com/questions/5782658/extracting-yaw-from-a-quaternion
final GVRTransform t = getMainCameraRig().getHeadTransform();
final Quaternionf q = new Quaternionf(0, t.getRotationY(), 0, t.getRotationW()).normalize... | [
"public",
"void",
"rotateToFaceCamera",
"(",
"final",
"GVRTransform",
"transform",
")",
"{",
"//see http://stackoverflow.com/questions/5782658/extracting-yaw-from-a-quaternion",
"final",
"GVRTransform",
"t",
"=",
"getMainCameraRig",
"(",
")",
".",
"getHeadTransform",
"(",
")"... | Apply the necessary rotation to the transform so that it is in front of
the camera.
@param transform The transform to modify. | [
"Apply",
"the",
"necessary",
"rotation",
"to",
"the",
"transform",
"so",
"that",
"it",
"is",
"in",
"front",
"of",
"the",
"camera",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/MainScene.java#L465-L471 |
161,584 | Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/MainScene.java | MainScene.rotateToFaceCamera | public float rotateToFaceCamera(final Widget widget) {
final float yaw = getMainCameraRigYaw();
GVRTransform t = getMainCameraRig().getHeadTransform();
widget.rotateWithPivot(t.getRotationW(), 0, t.getRotationY(), 0, 0, 0, 0);
return yaw;
} | java | public float rotateToFaceCamera(final Widget widget) {
final float yaw = getMainCameraRigYaw();
GVRTransform t = getMainCameraRig().getHeadTransform();
widget.rotateWithPivot(t.getRotationW(), 0, t.getRotationY(), 0, 0, 0, 0);
return yaw;
} | [
"public",
"float",
"rotateToFaceCamera",
"(",
"final",
"Widget",
"widget",
")",
"{",
"final",
"float",
"yaw",
"=",
"getMainCameraRigYaw",
"(",
")",
";",
"GVRTransform",
"t",
"=",
"getMainCameraRig",
"(",
")",
".",
"getHeadTransform",
"(",
")",
";",
"widget",
... | Apply the necessary rotation to the transform so that it is in front of
the camera. The actual rotation is performed not using the yaw angle but
using equivalent quaternion values for better accuracy. But the yaw angle
is still returned for backward compatibility.
@param widget The transform to modify.
@return The cam... | [
"Apply",
"the",
"necessary",
"rotation",
"to",
"the",
"transform",
"so",
"that",
"it",
"is",
"in",
"front",
"of",
"the",
"camera",
".",
"The",
"actual",
"rotation",
"is",
"performed",
"not",
"using",
"the",
"yaw",
"angle",
"but",
"using",
"equivalent",
"qu... | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/MainScene.java#L482-L487 |
161,585 | Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/MainScene.java | MainScene.updateFrontFacingRotation | public void updateFrontFacingRotation(float rotation) {
if (!Float.isNaN(rotation) && !equal(rotation, frontFacingRotation)) {
final float oldRotation = frontFacingRotation;
frontFacingRotation = rotation % 360;
for (OnFrontRotationChangedListener listener : mOnFrontRotationC... | java | public void updateFrontFacingRotation(float rotation) {
if (!Float.isNaN(rotation) && !equal(rotation, frontFacingRotation)) {
final float oldRotation = frontFacingRotation;
frontFacingRotation = rotation % 360;
for (OnFrontRotationChangedListener listener : mOnFrontRotationC... | [
"public",
"void",
"updateFrontFacingRotation",
"(",
"float",
"rotation",
")",
"{",
"if",
"(",
"!",
"Float",
".",
"isNaN",
"(",
"rotation",
")",
"&&",
"!",
"equal",
"(",
"rotation",
",",
"frontFacingRotation",
")",
")",
"{",
"final",
"float",
"oldRotation",
... | Set new front facing rotation
@param rotation | [
"Set",
"new",
"front",
"facing",
"rotation"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/MainScene.java#L503-L516 |
161,586 | Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/MainScene.java | MainScene.rotateToFront | public void rotateToFront() {
GVRTransform transform = mSceneRootObject.getTransform();
transform.setRotation(1, 0, 0, 0);
transform.rotateByAxisWithPivot(-frontFacingRotation + 180, 0, 1, 0, 0, 0, 0);
} | java | public void rotateToFront() {
GVRTransform transform = mSceneRootObject.getTransform();
transform.setRotation(1, 0, 0, 0);
transform.rotateByAxisWithPivot(-frontFacingRotation + 180, 0, 1, 0, 0, 0, 0);
} | [
"public",
"void",
"rotateToFront",
"(",
")",
"{",
"GVRTransform",
"transform",
"=",
"mSceneRootObject",
".",
"getTransform",
"(",
")",
";",
"transform",
".",
"setRotation",
"(",
"1",
",",
"0",
",",
"0",
",",
"0",
")",
";",
"transform",
".",
"rotateByAxisWi... | Rotate root widget to make it facing to the front of the scene | [
"Rotate",
"root",
"widget",
"to",
"make",
"it",
"facing",
"to",
"the",
"front",
"of",
"the",
"scene"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/MainScene.java#L537-L541 |
161,587 | Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/MainScene.java | MainScene.setScale | public void setScale(final float scale) {
if (equal(mScale, scale) != true) {
Log.d(TAG, "setScale(): old: %.2f, new: %.2f", mScale, scale);
mScale = scale;
setScale(mSceneRootObject, scale);
setScale(mMainCameraRootObject, scale);
setScale(mLeftCamera... | java | public void setScale(final float scale) {
if (equal(mScale, scale) != true) {
Log.d(TAG, "setScale(): old: %.2f, new: %.2f", mScale, scale);
mScale = scale;
setScale(mSceneRootObject, scale);
setScale(mMainCameraRootObject, scale);
setScale(mLeftCamera... | [
"public",
"void",
"setScale",
"(",
"final",
"float",
"scale",
")",
"{",
"if",
"(",
"equal",
"(",
"mScale",
",",
"scale",
")",
"!=",
"true",
")",
"{",
"Log",
".",
"d",
"(",
"TAG",
",",
"\"setScale(): old: %.2f, new: %.2f\"",
",",
"mScale",
",",
"scale",
... | Scale all widgets in Main Scene hierarchy
@param scale | [
"Scale",
"all",
"widgets",
"in",
"Main",
"Scene",
"hierarchy"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/MainScene.java#L566-L583 |
161,588 | Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAnimation.java | GVRAnimation.setRepeatMode | public GVRAnimation setRepeatMode(int repeatMode) {
if (GVRRepeatMode.invalidRepeatMode(repeatMode)) {
throw new IllegalArgumentException(repeatMode
+ " is not a valid repetition type");
}
mRepeatMode = repeatMode;
return this;
} | java | public GVRAnimation setRepeatMode(int repeatMode) {
if (GVRRepeatMode.invalidRepeatMode(repeatMode)) {
throw new IllegalArgumentException(repeatMode
+ " is not a valid repetition type");
}
mRepeatMode = repeatMode;
return this;
} | [
"public",
"GVRAnimation",
"setRepeatMode",
"(",
"int",
"repeatMode",
")",
"{",
"if",
"(",
"GVRRepeatMode",
".",
"invalidRepeatMode",
"(",
"repeatMode",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"repeatMode",
"+",
"\" is not a valid repetition typ... | Set the repeat type.
In the default {@linkplain GVRRepeatMode#ONCE run-once} mode, animations
run once, ignoring the {@linkplain #getRepeatCount() repeat count.} In
{@linkplain GVRRepeatMode#PINGPONG ping pong} and
{@linkplain GVRRepeatMode#REPEATED repeated} modes, animations do honor
the repeat count, which {@linkpl... | [
"Set",
"the",
"repeat",
"type",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAnimation.java#L211-L218 |
161,589 | Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAnimation.java | GVRAnimation.setOffset | public GVRAnimation setOffset(float startOffset)
{
if(startOffset<0 || startOffset>mDuration){
throw new IllegalArgumentException("offset should not be either negative or greater than duration");
}
animationOffset = startOffset;
mDuration = mDuration-animationOffset;
... | java | public GVRAnimation setOffset(float startOffset)
{
if(startOffset<0 || startOffset>mDuration){
throw new IllegalArgumentException("offset should not be either negative or greater than duration");
}
animationOffset = startOffset;
mDuration = mDuration-animationOffset;
... | [
"public",
"GVRAnimation",
"setOffset",
"(",
"float",
"startOffset",
")",
"{",
"if",
"(",
"startOffset",
"<",
"0",
"||",
"startOffset",
">",
"mDuration",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"offset should not be either negative or greater than du... | Sets the offset for the animation.
@param startOffset animation will start at the specified offset value
@return {@code this}, so you can chain setProperty() calls.
@throws IllegalArgumentException
If {@code startOffset} is either negative or greater than
the animation duration | [
"Sets",
"the",
"offset",
"for",
"the",
"animation",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAnimation.java#L263-L271 |
161,590 | Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAnimation.java | GVRAnimation.setDuration | public GVRAnimation setDuration(float start, float end)
{
if(start>end || start<0 || end>mDuration){
throw new IllegalArgumentException("start and end values are wrong");
}
animationOffset = start;
mDuration = end-start;
return this;
} | java | public GVRAnimation setDuration(float start, float end)
{
if(start>end || start<0 || end>mDuration){
throw new IllegalArgumentException("start and end values are wrong");
}
animationOffset = start;
mDuration = end-start;
return this;
} | [
"public",
"GVRAnimation",
"setDuration",
"(",
"float",
"start",
",",
"float",
"end",
")",
"{",
"if",
"(",
"start",
">",
"end",
"||",
"start",
"<",
"0",
"||",
"end",
">",
"mDuration",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"start and e... | Sets the duration for the animation to be played.
@param start the animation will start playing from the specified time
@param end the animation will stop playing at the specified time
@return {@code this}, so you can chain setProperty() calls.
@throws IllegalArgumentException
If {@code start} is either negative valu... | [
"Sets",
"the",
"duration",
"for",
"the",
"animation",
"to",
"be",
"played",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAnimation.java#L301-L309 |
161,591 | Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAnimation.java | GVRAnimation.setOnFinish | public GVRAnimation setOnFinish(GVROnFinish callback) {
mOnFinish = callback;
// Do the instance-of test at set-time, not at use-time
mOnRepeat = callback instanceof GVROnRepeat ? (GVROnRepeat) callback
: null;
if (mOnRepeat != null) {
mRepeatCount = -1; // l... | java | public GVRAnimation setOnFinish(GVROnFinish callback) {
mOnFinish = callback;
// Do the instance-of test at set-time, not at use-time
mOnRepeat = callback instanceof GVROnRepeat ? (GVROnRepeat) callback
: null;
if (mOnRepeat != null) {
mRepeatCount = -1; // l... | [
"public",
"GVRAnimation",
"setOnFinish",
"(",
"GVROnFinish",
"callback",
")",
"{",
"mOnFinish",
"=",
"callback",
";",
"// Do the instance-of test at set-time, not at use-time",
"mOnRepeat",
"=",
"callback",
"instanceof",
"GVROnRepeat",
"?",
"(",
"GVROnRepeat",
")",
"callb... | Set the on-finish callback.
The basic {@link GVROnFinish} callback will notify you when the animation
runs to completion. This is a good time to do things like removing
now-invisible objects from the scene graph.
<p>
The extended {@link GVROnRepeat} callback will be called after every
iteration of an indefinite (repe... | [
"Set",
"the",
"on",
"-",
"finish",
"callback",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAnimation.java#L333-L343 |
161,592 | Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRRenderData.java | GVRRenderData.bindShader | public synchronized void bindShader(GVRScene scene, boolean isMultiview)
{
GVRRenderPass pass = mRenderPassList.get(0);
GVRShaderId shader = pass.getMaterial().getShaderType();
GVRShader template = shader.getTemplate(getGVRContext());
if (template != null)
{
templ... | java | public synchronized void bindShader(GVRScene scene, boolean isMultiview)
{
GVRRenderPass pass = mRenderPassList.get(0);
GVRShaderId shader = pass.getMaterial().getShaderType();
GVRShader template = shader.getTemplate(getGVRContext());
if (template != null)
{
templ... | [
"public",
"synchronized",
"void",
"bindShader",
"(",
"GVRScene",
"scene",
",",
"boolean",
"isMultiview",
")",
"{",
"GVRRenderPass",
"pass",
"=",
"mRenderPassList",
".",
"get",
"(",
"0",
")",
";",
"GVRShaderId",
"shader",
"=",
"pass",
".",
"getMaterial",
"(",
... | Selects a specific vertex and fragment shader to use for rendering.
If a shader template has been specified, it is used to generate
a vertex and fragment shader based on mesh attributes, bound textures
and light sources. If the textures bound to the material are changed
or a new light source is added, this function mu... | [
"Selects",
"a",
"specific",
"vertex",
"and",
"fragment",
"shader",
"to",
"use",
"for",
"rendering",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRRenderData.java#L264-L283 |
161,593 | Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRRenderData.java | GVRRenderData.setCullFace | public GVRRenderData setCullFace(GVRCullFaceEnum cullFace, int passIndex) {
if (passIndex < mRenderPassList.size()) {
mRenderPassList.get(passIndex).setCullFace(cullFace);
} else {
Log.e(TAG, "Trying to set cull face to a invalid pass. Pass " + passIndex + " was not created.");
... | java | public GVRRenderData setCullFace(GVRCullFaceEnum cullFace, int passIndex) {
if (passIndex < mRenderPassList.size()) {
mRenderPassList.get(passIndex).setCullFace(cullFace);
} else {
Log.e(TAG, "Trying to set cull face to a invalid pass. Pass " + passIndex + " was not created.");
... | [
"public",
"GVRRenderData",
"setCullFace",
"(",
"GVRCullFaceEnum",
"cullFace",
",",
"int",
"passIndex",
")",
"{",
"if",
"(",
"passIndex",
"<",
"mRenderPassList",
".",
"size",
"(",
")",
")",
"{",
"mRenderPassList",
".",
"get",
"(",
"passIndex",
")",
".",
"setC... | Set the face to be culled
@param cullFace
{@code GVRCullFaceEnum.Back} Tells Graphics API to discard
back faces, {@code GVRCullFaceEnum.Front} Tells Graphics API
to discard front faces, {@code GVRCullFaceEnum.None} Tells
Graphics API to not discard any face
@param passIndex
The rendering pass to set cull face state | [
"Set",
"the",
"face",
"to",
"be",
"culled"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRRenderData.java#L494-L501 |
161,594 | Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRRenderData.java | GVRRenderData.setDrawMode | public GVRRenderData setDrawMode(int drawMode) {
if (drawMode != GL_POINTS && drawMode != GL_LINES
&& drawMode != GL_LINE_STRIP && drawMode != GL_LINE_LOOP
&& drawMode != GL_TRIANGLES && drawMode != GL_TRIANGLE_STRIP
&& drawMode != GL_TRIANGLE_FAN) {
t... | java | public GVRRenderData setDrawMode(int drawMode) {
if (drawMode != GL_POINTS && drawMode != GL_LINES
&& drawMode != GL_LINE_STRIP && drawMode != GL_LINE_LOOP
&& drawMode != GL_TRIANGLES && drawMode != GL_TRIANGLE_STRIP
&& drawMode != GL_TRIANGLE_FAN) {
t... | [
"public",
"GVRRenderData",
"setDrawMode",
"(",
"int",
"drawMode",
")",
"{",
"if",
"(",
"drawMode",
"!=",
"GL_POINTS",
"&&",
"drawMode",
"!=",
"GL_LINES",
"&&",
"drawMode",
"!=",
"GL_LINE_STRIP",
"&&",
"drawMode",
"!=",
"GL_LINE_LOOP",
"&&",
"drawMode",
"!=",
"... | Set the draw mode for this mesh. Default is GL_TRIANGLES.
@param drawMode | [
"Set",
"the",
"draw",
"mode",
"for",
"this",
"mesh",
".",
"Default",
"is",
"GL_TRIANGLES",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRRenderData.java#L749-L759 |
161,595 | Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/LayoutScroller.java | LayoutScroller.fling | public boolean fling(float velocityX, float velocityY, float velocityZ) {
boolean scrolled = true;
float viewportX = mScrollable.getViewPortWidth();
if (Float.isNaN(viewportX)) {
viewportX = 0;
}
float maxX = Math.min(MAX_SCROLLING_DISTANCE,
viewportX... | java | public boolean fling(float velocityX, float velocityY, float velocityZ) {
boolean scrolled = true;
float viewportX = mScrollable.getViewPortWidth();
if (Float.isNaN(viewportX)) {
viewportX = 0;
}
float maxX = Math.min(MAX_SCROLLING_DISTANCE,
viewportX... | [
"public",
"boolean",
"fling",
"(",
"float",
"velocityX",
",",
"float",
"velocityY",
",",
"float",
"velocityZ",
")",
"{",
"boolean",
"scrolled",
"=",
"true",
";",
"float",
"viewportX",
"=",
"mScrollable",
".",
"getViewPortWidth",
"(",
")",
";",
"if",
"(",
"... | Fling the content
@param velocityX The initial velocity in the X direction. Positive numbers mean that the
finger/cursor is moving to the left on the screen, which means we want to
scroll towards the beginning.
@param velocityY The initial velocity in the Y direction. Positive numbers mean that the
finger/cursor is mo... | [
"Fling",
"the",
"content"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/LayoutScroller.java#L207-L242 |
161,596 | Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/LayoutScroller.java | LayoutScroller.scrollToNextPage | public int scrollToNextPage() {
Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "scrollToNextPage getCurrentPage() = %d currentIndex = %d",
getCurrentPage(), mCurrentItemIndex);
if (mSupportScrollByPage) {
scrollToPage(getCurrentPage() + 1);
} else {
Log.w(TAG, "Paginat... | java | public int scrollToNextPage() {
Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "scrollToNextPage getCurrentPage() = %d currentIndex = %d",
getCurrentPage(), mCurrentItemIndex);
if (mSupportScrollByPage) {
scrollToPage(getCurrentPage() + 1);
} else {
Log.w(TAG, "Paginat... | [
"public",
"int",
"scrollToNextPage",
"(",
")",
"{",
"Log",
".",
"d",
"(",
"Log",
".",
"SUBSYSTEM",
".",
"LAYOUT",
",",
"TAG",
",",
"\"scrollToNextPage getCurrentPage() = %d currentIndex = %d\"",
",",
"getCurrentPage",
"(",
")",
",",
"mCurrentItemIndex",
")",
";",
... | Scroll to the next page. To process the scrolling by pages LayoutScroller must be constructed
with a pageSize greater than zero.
@return the new current item after the scrolling processed. | [
"Scroll",
"to",
"the",
"next",
"page",
".",
"To",
"process",
"the",
"scrolling",
"by",
"pages",
"LayoutScroller",
"must",
"be",
"constructed",
"with",
"a",
"pageSize",
"greater",
"than",
"zero",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/LayoutScroller.java#L249-L260 |
161,597 | Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/LayoutScroller.java | LayoutScroller.scrollToPage | public int scrollToPage(int pageNumber) {
Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "scrollToPage pageNumber = %d mPageCount = %d",
pageNumber, mPageCount);
if (mSupportScrollByPage &&
(mScrollOver || (pageNumber >= 0 && pageNumber <= mPageCount - 1))) {
scrollToItem(... | java | public int scrollToPage(int pageNumber) {
Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "scrollToPage pageNumber = %d mPageCount = %d",
pageNumber, mPageCount);
if (mSupportScrollByPage &&
(mScrollOver || (pageNumber >= 0 && pageNumber <= mPageCount - 1))) {
scrollToItem(... | [
"public",
"int",
"scrollToPage",
"(",
"int",
"pageNumber",
")",
"{",
"Log",
".",
"d",
"(",
"Log",
".",
"SUBSYSTEM",
".",
"LAYOUT",
",",
"TAG",
",",
"\"scrollToPage pageNumber = %d mPageCount = %d\"",
",",
"pageNumber",
",",
"mPageCount",
")",
";",
"if",
"(",
... | Scroll to specific page. The final page might be different from the requested one if the
requested page is larger than the last page. To process the scrolling by pages
LayoutScroller must be constructed with a pageSize greater than zero.
@param pageNumber page to scroll to
@return the new current item after the scrolli... | [
"Scroll",
"to",
"specific",
"page",
".",
"The",
"final",
"page",
"might",
"be",
"different",
"from",
"the",
"requested",
"one",
"if",
"the",
"requested",
"page",
"is",
"larger",
"than",
"the",
"last",
"page",
".",
"To",
"process",
"the",
"scrolling",
"by",... | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/LayoutScroller.java#L286-L297 |
161,598 | Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/LayoutScroller.java | LayoutScroller.scrollToItem | public int scrollToItem(int position) {
Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "scrollToItem position = %d", position);
scrollToPosition(position);
return mCurrentItemIndex;
} | java | public int scrollToItem(int position) {
Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "scrollToItem position = %d", position);
scrollToPosition(position);
return mCurrentItemIndex;
} | [
"public",
"int",
"scrollToItem",
"(",
"int",
"position",
")",
"{",
"Log",
".",
"d",
"(",
"Log",
".",
"SUBSYSTEM",
".",
"LAYOUT",
",",
"TAG",
",",
"\"scrollToItem position = %d\"",
",",
"position",
")",
";",
"scrollToPosition",
"(",
"position",
")",
";",
"r... | Scroll to the specific position
@param position
@return the new current item after the scrolling processed. | [
"Scroll",
"to",
"the",
"specific",
"position"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/LayoutScroller.java#L336-L340 |
161,599 | Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/LayoutScroller.java | LayoutScroller.getCurrentPage | public int getCurrentPage() {
int currentPage = 1;
int count = mScrollable.getScrollingItemsCount();
if (mSupportScrollByPage && mCurrentItemIndex >= 0 &&
mCurrentItemIndex < count) {
currentPage = (Math.min(mCurrentItemIndex + mPageSize - 1, count - 1)/mPageSize);
... | java | public int getCurrentPage() {
int currentPage = 1;
int count = mScrollable.getScrollingItemsCount();
if (mSupportScrollByPage && mCurrentItemIndex >= 0 &&
mCurrentItemIndex < count) {
currentPage = (Math.min(mCurrentItemIndex + mPageSize - 1, count - 1)/mPageSize);
... | [
"public",
"int",
"getCurrentPage",
"(",
")",
"{",
"int",
"currentPage",
"=",
"1",
";",
"int",
"count",
"=",
"mScrollable",
".",
"getScrollingItemsCount",
"(",
")",
";",
"if",
"(",
"mSupportScrollByPage",
"&&",
"mCurrentItemIndex",
">=",
"0",
"&&",
"mCurrentIte... | Gets the current page
@return | [
"Gets",
"the",
"current",
"page"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/LayoutScroller.java#L346-L354 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.