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
20,900
joelittlejohn/jsonschema2pojo
jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/util/NameHelper.java
NameHelper.getFieldName
public String getFieldName(String propertyName, JsonNode node) { if (node != null && node.has("javaName")) { propertyName = node.get("javaName").textValue(); } return propertyName; }
java
public String getFieldName(String propertyName, JsonNode node) { if (node != null && node.has("javaName")) { propertyName = node.get("javaName").textValue(); } return propertyName; }
[ "public", "String", "getFieldName", "(", "String", "propertyName", ",", "JsonNode", "node", ")", "{", "if", "(", "node", "!=", "null", "&&", "node", ".", "has", "(", "\"javaName\"", ")", ")", "{", "propertyName", "=", "node", ".", "get", "(", "\"javaName\"", ")", ".", "textValue", "(", ")", ";", "}", "return", "propertyName", ";", "}" ]
Get name of the field generated from property. @param propertyName @param node @return
[ "Get", "name", "of", "the", "field", "generated", "from", "property", "." ]
0552b80db93214eb186e4ae45b40866cc1e7eb84
https://github.com/joelittlejohn/jsonschema2pojo/blob/0552b80db93214eb186e4ae45b40866cc1e7eb84/jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/util/NameHelper.java#L166-L173
20,901
joelittlejohn/jsonschema2pojo
jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/util/NameHelper.java
NameHelper.getGetterName
public String getGetterName(String propertyName, JType type, JsonNode node) { propertyName = getPropertyNameForAccessor(propertyName, node); String prefix = type.equals(type.owner()._ref(boolean.class)) ? "is" : "get"; String getterName; if (propertyName.length() > 1 && Character.isUpperCase(propertyName.charAt(1))) { getterName = prefix + propertyName; } else { getterName = prefix + capitalize(propertyName); } if (getterName.equals("getClass")) { getterName = "getClass_"; } return getterName; }
java
public String getGetterName(String propertyName, JType type, JsonNode node) { propertyName = getPropertyNameForAccessor(propertyName, node); String prefix = type.equals(type.owner()._ref(boolean.class)) ? "is" : "get"; String getterName; if (propertyName.length() > 1 && Character.isUpperCase(propertyName.charAt(1))) { getterName = prefix + propertyName; } else { getterName = prefix + capitalize(propertyName); } if (getterName.equals("getClass")) { getterName = "getClass_"; } return getterName; }
[ "public", "String", "getGetterName", "(", "String", "propertyName", ",", "JType", "type", ",", "JsonNode", "node", ")", "{", "propertyName", "=", "getPropertyNameForAccessor", "(", "propertyName", ",", "node", ")", ";", "String", "prefix", "=", "type", ".", "equals", "(", "type", ".", "owner", "(", ")", ".", "_ref", "(", "boolean", ".", "class", ")", ")", "?", "\"is\"", ":", "\"get\"", ";", "String", "getterName", ";", "if", "(", "propertyName", ".", "length", "(", ")", ">", "1", "&&", "Character", ".", "isUpperCase", "(", "propertyName", ".", "charAt", "(", "1", ")", ")", ")", "{", "getterName", "=", "prefix", "+", "propertyName", ";", "}", "else", "{", "getterName", "=", "prefix", "+", "capitalize", "(", "propertyName", ")", ";", "}", "if", "(", "getterName", ".", "equals", "(", "\"getClass\"", ")", ")", "{", "getterName", "=", "\"getClass_\"", ";", "}", "return", "getterName", ";", "}" ]
Generate getter method name for property. @param propertyName @param type @param node @return
[ "Generate", "getter", "method", "name", "for", "property", "." ]
0552b80db93214eb186e4ae45b40866cc1e7eb84
https://github.com/joelittlejohn/jsonschema2pojo/blob/0552b80db93214eb186e4ae45b40866cc1e7eb84/jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/util/NameHelper.java#L197-L214
20,902
joelittlejohn/jsonschema2pojo
jsonschema2pojo-maven-plugin/src/main/java/org/jsonschema2pojo/maven/ProjectClasspath.java
ProjectClasspath.getClassLoader
public ClassLoader getClassLoader(MavenProject project, final ClassLoader parent, Log log) throws DependencyResolutionRequiredException { @SuppressWarnings("unchecked") List<String> classpathElements = project.getCompileClasspathElements(); final List<URL> classpathUrls = new ArrayList<>(classpathElements.size()); for (String classpathElement : classpathElements) { try { log.debug("Adding project artifact to classpath: " + classpathElement); classpathUrls.add(new File(classpathElement).toURI().toURL()); } catch (MalformedURLException e) { log.debug("Unable to use classpath entry as it could not be understood as a valid URL: " + classpathElement, e); } } return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() { @Override public ClassLoader run() { return new URLClassLoader(classpathUrls.toArray(new URL[classpathUrls.size()]), parent); } }); }
java
public ClassLoader getClassLoader(MavenProject project, final ClassLoader parent, Log log) throws DependencyResolutionRequiredException { @SuppressWarnings("unchecked") List<String> classpathElements = project.getCompileClasspathElements(); final List<URL> classpathUrls = new ArrayList<>(classpathElements.size()); for (String classpathElement : classpathElements) { try { log.debug("Adding project artifact to classpath: " + classpathElement); classpathUrls.add(new File(classpathElement).toURI().toURL()); } catch (MalformedURLException e) { log.debug("Unable to use classpath entry as it could not be understood as a valid URL: " + classpathElement, e); } } return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() { @Override public ClassLoader run() { return new URLClassLoader(classpathUrls.toArray(new URL[classpathUrls.size()]), parent); } }); }
[ "public", "ClassLoader", "getClassLoader", "(", "MavenProject", "project", ",", "final", "ClassLoader", "parent", ",", "Log", "log", ")", "throws", "DependencyResolutionRequiredException", "{", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "List", "<", "String", ">", "classpathElements", "=", "project", ".", "getCompileClasspathElements", "(", ")", ";", "final", "List", "<", "URL", ">", "classpathUrls", "=", "new", "ArrayList", "<>", "(", "classpathElements", ".", "size", "(", ")", ")", ";", "for", "(", "String", "classpathElement", ":", "classpathElements", ")", "{", "try", "{", "log", ".", "debug", "(", "\"Adding project artifact to classpath: \"", "+", "classpathElement", ")", ";", "classpathUrls", ".", "add", "(", "new", "File", "(", "classpathElement", ")", ".", "toURI", "(", ")", ".", "toURL", "(", ")", ")", ";", "}", "catch", "(", "MalformedURLException", "e", ")", "{", "log", ".", "debug", "(", "\"Unable to use classpath entry as it could not be understood as a valid URL: \"", "+", "classpathElement", ",", "e", ")", ";", "}", "}", "return", "AccessController", ".", "doPrivileged", "(", "new", "PrivilegedAction", "<", "ClassLoader", ">", "(", ")", "{", "@", "Override", "public", "ClassLoader", "run", "(", ")", "{", "return", "new", "URLClassLoader", "(", "classpathUrls", ".", "toArray", "(", "new", "URL", "[", "classpathUrls", ".", "size", "(", ")", "]", ")", ",", "parent", ")", ";", "}", "}", ")", ";", "}" ]
Provides a class loader that can be used to load classes from this project classpath. @param project the maven project currently being built @param parent a classloader which should be used as the parent of the newly created classloader. @param log object to which details of the found/loaded classpath elements can be logged. @return a classloader that can be used to load any class that is contained in the set of artifacts that this project classpath is based on. @throws DependencyResolutionRequiredException if maven encounters a problem resolving project dependencies
[ "Provides", "a", "class", "loader", "that", "can", "be", "used", "to", "load", "classes", "from", "this", "project", "classpath", "." ]
0552b80db93214eb186e4ae45b40866cc1e7eb84
https://github.com/joelittlejohn/jsonschema2pojo/blob/0552b80db93214eb186e4ae45b40866cc1e7eb84/jsonschema2pojo-maven-plugin/src/main/java/org/jsonschema2pojo/maven/ProjectClasspath.java#L56-L81
20,903
joelittlejohn/jsonschema2pojo
jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/PrimitiveTypes.java
PrimitiveTypes.isPrimitive
public static boolean isPrimitive(String name, JCodeModel owner) { try { return JType.parse(owner, name) != owner.VOID; } catch (IllegalArgumentException e) { return false; } }
java
public static boolean isPrimitive(String name, JCodeModel owner) { try { return JType.parse(owner, name) != owner.VOID; } catch (IllegalArgumentException e) { return false; } }
[ "public", "static", "boolean", "isPrimitive", "(", "String", "name", ",", "JCodeModel", "owner", ")", "{", "try", "{", "return", "JType", ".", "parse", "(", "owner", ",", "name", ")", "!=", "owner", ".", "VOID", ";", "}", "catch", "(", "IllegalArgumentException", "e", ")", "{", "return", "false", ";", "}", "}" ]
Check if a name string refers to a given type. @param name the name of a Java type @param owner the current code model for type generation @return <code>true</code> when the given name refers to a primitive Java type (e.g. "int"), otherwise <code>false</code>
[ "Check", "if", "a", "name", "string", "refers", "to", "a", "given", "type", "." ]
0552b80db93214eb186e4ae45b40866cc1e7eb84
https://github.com/joelittlejohn/jsonschema2pojo/blob/0552b80db93214eb186e4ae45b40866cc1e7eb84/jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/PrimitiveTypes.java#L43-L49
20,904
joelittlejohn/jsonschema2pojo
jsonschema2pojo-maven-plugin/src/main/java/org/jsonschema2pojo/maven/Jsonschema2PojoMojo.java
Jsonschema2PojoMojo.execute
@Override @edu.umd.cs.findbugs.annotations.SuppressWarnings(value = { "NP_UNWRITTEN_FIELD", "UWF_UNWRITTEN_FIELD" }, justification = "Private fields set by Maven.") @SuppressWarnings("PMD.UselessParentheses") public void execute() throws MojoExecutionException { addProjectDependenciesToClasspath(); try { getAnnotationStyle(); } catch (IllegalArgumentException e) { throw new MojoExecutionException("Not a valid annotation style: " + annotationStyle); } try { new AnnotatorFactory(this).getAnnotator(getCustomAnnotator()); } catch (IllegalArgumentException e) { throw new MojoExecutionException(e.getMessage(), e); } if (skip) { return; } // verify source directories if (sourceDirectory != null) { sourceDirectory = FilenameUtils.normalize(sourceDirectory); // verify sourceDirectory try { URLUtil.parseURL(sourceDirectory); } catch (IllegalArgumentException e) { throw new MojoExecutionException(e.getMessage(), e); } } else if (!isEmpty(sourcePaths)) { // verify individual source paths for (int i = 0; i < sourcePaths.length; i++) { sourcePaths[i] = FilenameUtils.normalize(sourcePaths[i]); try { URLUtil.parseURL(sourcePaths[i]); } catch (IllegalArgumentException e) { throw new MojoExecutionException(e.getMessage(), e); } } } else { throw new MojoExecutionException("One of sourceDirectory or sourcePaths must be provided"); } if (filteringEnabled() || (sourceDirectory != null && isEmpty(sourcePaths))) { if (sourceDirectory == null) { throw new MojoExecutionException("Source includes and excludes require the sourceDirectory property"); } if (!isEmpty(sourcePaths)) { throw new MojoExecutionException("Source includes and excludes are incompatible with the sourcePaths property"); } fileFilter = createFileFilter(); } if (addCompileSourceRoot) { project.addCompileSourceRoot(outputDirectory.getPath()); } if (useCommonsLang3) { getLog().warn("useCommonsLang3 is deprecated. Please remove it from your config."); } try { Jsonschema2Pojo.generate(this); } catch (IOException e) { throw new MojoExecutionException("Error generating classes from JSON Schema file(s) " + sourceDirectory, e); } }
java
@Override @edu.umd.cs.findbugs.annotations.SuppressWarnings(value = { "NP_UNWRITTEN_FIELD", "UWF_UNWRITTEN_FIELD" }, justification = "Private fields set by Maven.") @SuppressWarnings("PMD.UselessParentheses") public void execute() throws MojoExecutionException { addProjectDependenciesToClasspath(); try { getAnnotationStyle(); } catch (IllegalArgumentException e) { throw new MojoExecutionException("Not a valid annotation style: " + annotationStyle); } try { new AnnotatorFactory(this).getAnnotator(getCustomAnnotator()); } catch (IllegalArgumentException e) { throw new MojoExecutionException(e.getMessage(), e); } if (skip) { return; } // verify source directories if (sourceDirectory != null) { sourceDirectory = FilenameUtils.normalize(sourceDirectory); // verify sourceDirectory try { URLUtil.parseURL(sourceDirectory); } catch (IllegalArgumentException e) { throw new MojoExecutionException(e.getMessage(), e); } } else if (!isEmpty(sourcePaths)) { // verify individual source paths for (int i = 0; i < sourcePaths.length; i++) { sourcePaths[i] = FilenameUtils.normalize(sourcePaths[i]); try { URLUtil.parseURL(sourcePaths[i]); } catch (IllegalArgumentException e) { throw new MojoExecutionException(e.getMessage(), e); } } } else { throw new MojoExecutionException("One of sourceDirectory or sourcePaths must be provided"); } if (filteringEnabled() || (sourceDirectory != null && isEmpty(sourcePaths))) { if (sourceDirectory == null) { throw new MojoExecutionException("Source includes and excludes require the sourceDirectory property"); } if (!isEmpty(sourcePaths)) { throw new MojoExecutionException("Source includes and excludes are incompatible with the sourcePaths property"); } fileFilter = createFileFilter(); } if (addCompileSourceRoot) { project.addCompileSourceRoot(outputDirectory.getPath()); } if (useCommonsLang3) { getLog().warn("useCommonsLang3 is deprecated. Please remove it from your config."); } try { Jsonschema2Pojo.generate(this); } catch (IOException e) { throw new MojoExecutionException("Error generating classes from JSON Schema file(s) " + sourceDirectory, e); } }
[ "@", "Override", "@", "edu", ".", "umd", ".", "cs", ".", "findbugs", ".", "annotations", ".", "SuppressWarnings", "(", "value", "=", "{", "\"NP_UNWRITTEN_FIELD\"", ",", "\"UWF_UNWRITTEN_FIELD\"", "}", ",", "justification", "=", "\"Private fields set by Maven.\"", ")", "@", "SuppressWarnings", "(", "\"PMD.UselessParentheses\"", ")", "public", "void", "execute", "(", ")", "throws", "MojoExecutionException", "{", "addProjectDependenciesToClasspath", "(", ")", ";", "try", "{", "getAnnotationStyle", "(", ")", ";", "}", "catch", "(", "IllegalArgumentException", "e", ")", "{", "throw", "new", "MojoExecutionException", "(", "\"Not a valid annotation style: \"", "+", "annotationStyle", ")", ";", "}", "try", "{", "new", "AnnotatorFactory", "(", "this", ")", ".", "getAnnotator", "(", "getCustomAnnotator", "(", ")", ")", ";", "}", "catch", "(", "IllegalArgumentException", "e", ")", "{", "throw", "new", "MojoExecutionException", "(", "e", ".", "getMessage", "(", ")", ",", "e", ")", ";", "}", "if", "(", "skip", ")", "{", "return", ";", "}", "// verify source directories", "if", "(", "sourceDirectory", "!=", "null", ")", "{", "sourceDirectory", "=", "FilenameUtils", ".", "normalize", "(", "sourceDirectory", ")", ";", "// verify sourceDirectory", "try", "{", "URLUtil", ".", "parseURL", "(", "sourceDirectory", ")", ";", "}", "catch", "(", "IllegalArgumentException", "e", ")", "{", "throw", "new", "MojoExecutionException", "(", "e", ".", "getMessage", "(", ")", ",", "e", ")", ";", "}", "}", "else", "if", "(", "!", "isEmpty", "(", "sourcePaths", ")", ")", "{", "// verify individual source paths", "for", "(", "int", "i", "=", "0", ";", "i", "<", "sourcePaths", ".", "length", ";", "i", "++", ")", "{", "sourcePaths", "[", "i", "]", "=", "FilenameUtils", ".", "normalize", "(", "sourcePaths", "[", "i", "]", ")", ";", "try", "{", "URLUtil", ".", "parseURL", "(", "sourcePaths", "[", "i", "]", ")", ";", "}", "catch", "(", "IllegalArgumentException", "e", ")", "{", "throw", "new", "MojoExecutionException", "(", "e", ".", "getMessage", "(", ")", ",", "e", ")", ";", "}", "}", "}", "else", "{", "throw", "new", "MojoExecutionException", "(", "\"One of sourceDirectory or sourcePaths must be provided\"", ")", ";", "}", "if", "(", "filteringEnabled", "(", ")", "||", "(", "sourceDirectory", "!=", "null", "&&", "isEmpty", "(", "sourcePaths", ")", ")", ")", "{", "if", "(", "sourceDirectory", "==", "null", ")", "{", "throw", "new", "MojoExecutionException", "(", "\"Source includes and excludes require the sourceDirectory property\"", ")", ";", "}", "if", "(", "!", "isEmpty", "(", "sourcePaths", ")", ")", "{", "throw", "new", "MojoExecutionException", "(", "\"Source includes and excludes are incompatible with the sourcePaths property\"", ")", ";", "}", "fileFilter", "=", "createFileFilter", "(", ")", ";", "}", "if", "(", "addCompileSourceRoot", ")", "{", "project", ".", "addCompileSourceRoot", "(", "outputDirectory", ".", "getPath", "(", ")", ")", ";", "}", "if", "(", "useCommonsLang3", ")", "{", "getLog", "(", ")", ".", "warn", "(", "\"useCommonsLang3 is deprecated. Please remove it from your config.\"", ")", ";", "}", "try", "{", "Jsonschema2Pojo", ".", "generate", "(", "this", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "MojoExecutionException", "(", "\"Error generating classes from JSON Schema file(s) \"", "+", "sourceDirectory", ",", "e", ")", ";", "}", "}" ]
Executes the plugin, to read the given source and behavioural properties and generate POJOs. The current implementation acts as a wrapper around the command line interface.
[ "Executes", "the", "plugin", "to", "read", "the", "given", "source", "and", "behavioural", "properties", "and", "generate", "POJOs", ".", "The", "current", "implementation", "acts", "as", "a", "wrapper", "around", "the", "command", "line", "interface", "." ]
0552b80db93214eb186e4ae45b40866cc1e7eb84
https://github.com/joelittlejohn/jsonschema2pojo/blob/0552b80db93214eb186e4ae45b40866cc1e7eb84/jsonschema2pojo-maven-plugin/src/main/java/org/jsonschema2pojo/maven/Jsonschema2PojoMojo.java#L771-L844
20,905
joelittlejohn/jsonschema2pojo
jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/SchemaMapper.java
SchemaMapper.generate
public JType generate(JCodeModel codeModel, String className, String packageName, URL schemaUrl) { JPackage jpackage = codeModel._package(packageName); ObjectNode schemaNode = readSchema(schemaUrl); return ruleFactory.getSchemaRule().apply(className, schemaNode, null, jpackage, new Schema(null, schemaNode, null)); }
java
public JType generate(JCodeModel codeModel, String className, String packageName, URL schemaUrl) { JPackage jpackage = codeModel._package(packageName); ObjectNode schemaNode = readSchema(schemaUrl); return ruleFactory.getSchemaRule().apply(className, schemaNode, null, jpackage, new Schema(null, schemaNode, null)); }
[ "public", "JType", "generate", "(", "JCodeModel", "codeModel", ",", "String", "className", ",", "String", "packageName", ",", "URL", "schemaUrl", ")", "{", "JPackage", "jpackage", "=", "codeModel", ".", "_package", "(", "packageName", ")", ";", "ObjectNode", "schemaNode", "=", "readSchema", "(", "schemaUrl", ")", ";", "return", "ruleFactory", ".", "getSchemaRule", "(", ")", ".", "apply", "(", "className", ",", "schemaNode", ",", "null", ",", "jpackage", ",", "new", "Schema", "(", "null", ",", "schemaNode", ",", "null", ")", ")", ";", "}" ]
Reads a schema and adds generated types to the given code model. @param codeModel the java code-generation context that should be used to generated new types @param className the name of the parent class the represented by this schema @param packageName the target package that should be used for generated types @param schemaUrl location of the schema to be used as input @return The top-most type generated from the given file @throws IOException if the schema content cannot be read
[ "Reads", "a", "schema", "and", "adds", "generated", "types", "to", "the", "given", "code", "model", "." ]
0552b80db93214eb186e4ae45b40866cc1e7eb84
https://github.com/joelittlejohn/jsonschema2pojo/blob/0552b80db93214eb186e4ae45b40866cc1e7eb84/jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/SchemaMapper.java#L86-L94
20,906
joelittlejohn/jsonschema2pojo
jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/SchemaStore.java
SchemaStore.create
public synchronized Schema create(URI id, String refFragmentPathDelimiters) { if (!schemas.containsKey(id)) { URI baseId = removeFragment(id); JsonNode baseContent = contentResolver.resolve(baseId); Schema baseSchema = new Schema(baseId, baseContent, null); if (id.toString().contains("#")) { JsonNode childContent = fragmentResolver.resolve(baseContent, '#' + id.getFragment(), refFragmentPathDelimiters); schemas.put(id, new Schema(id, childContent, baseSchema)); } else { schemas.put(id, baseSchema); } } return schemas.get(id); }
java
public synchronized Schema create(URI id, String refFragmentPathDelimiters) { if (!schemas.containsKey(id)) { URI baseId = removeFragment(id); JsonNode baseContent = contentResolver.resolve(baseId); Schema baseSchema = new Schema(baseId, baseContent, null); if (id.toString().contains("#")) { JsonNode childContent = fragmentResolver.resolve(baseContent, '#' + id.getFragment(), refFragmentPathDelimiters); schemas.put(id, new Schema(id, childContent, baseSchema)); } else { schemas.put(id, baseSchema); } } return schemas.get(id); }
[ "public", "synchronized", "Schema", "create", "(", "URI", "id", ",", "String", "refFragmentPathDelimiters", ")", "{", "if", "(", "!", "schemas", ".", "containsKey", "(", "id", ")", ")", "{", "URI", "baseId", "=", "removeFragment", "(", "id", ")", ";", "JsonNode", "baseContent", "=", "contentResolver", ".", "resolve", "(", "baseId", ")", ";", "Schema", "baseSchema", "=", "new", "Schema", "(", "baseId", ",", "baseContent", ",", "null", ")", ";", "if", "(", "id", ".", "toString", "(", ")", ".", "contains", "(", "\"#\"", ")", ")", "{", "JsonNode", "childContent", "=", "fragmentResolver", ".", "resolve", "(", "baseContent", ",", "'", "'", "+", "id", ".", "getFragment", "(", ")", ",", "refFragmentPathDelimiters", ")", ";", "schemas", ".", "put", "(", "id", ",", "new", "Schema", "(", "id", ",", "childContent", ",", "baseSchema", ")", ")", ";", "}", "else", "{", "schemas", ".", "put", "(", "id", ",", "baseSchema", ")", ";", "}", "}", "return", "schemas", ".", "get", "(", "id", ")", ";", "}" ]
Create or look up a new schema which has the given ID and read the contents of the given ID as a URL. If a schema with the given ID is already known, then a reference to the original schema will be returned. @param id the id of the schema being created @param refFragmentPathDelimiters A string containing any characters that should act as path delimiters when resolving $ref fragments. @return a schema object containing the contents of the given path
[ "Create", "or", "look", "up", "a", "new", "schema", "which", "has", "the", "given", "ID", "and", "read", "the", "contents", "of", "the", "given", "ID", "as", "a", "URL", ".", "If", "a", "schema", "with", "the", "given", "ID", "is", "already", "known", "then", "a", "reference", "to", "the", "original", "schema", "will", "be", "returned", "." ]
0552b80db93214eb186e4ae45b40866cc1e7eb84
https://github.com/joelittlejohn/jsonschema2pojo/blob/0552b80db93214eb186e4ae45b40866cc1e7eb84/jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/SchemaStore.java#L54-L71
20,907
joelittlejohn/jsonschema2pojo
jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/SchemaStore.java
SchemaStore.create
@SuppressWarnings("PMD.UselessParentheses") public Schema create(Schema parent, String path, String refFragmentPathDelimiters) { if (!path.equals("#")) { // if path is an empty string then resolving it below results in jumping up a level. e.g. "/path/to/file.json" becomes "/path/to" path = stripEnd(path, "#?&/"); } // encode the fragment for any funny characters if (path.contains("#")) { String pathExcludingFragment = substringBefore(path, "#"); String fragment = substringAfter(path, "#"); URI fragmentURI; try { fragmentURI = new URI(null, null, fragment); } catch (URISyntaxException e) { throw new IllegalArgumentException("Invalid fragment: " + fragment + " in path: " + path); } path = pathExcludingFragment + "#" + fragmentURI.getRawFragment(); } URI id = (parent == null || parent.getId() == null) ? URI.create(path) : parent.getId().resolve(path); String stringId = id.toString(); if (stringId.endsWith("#")) { try { id = new URI(stripEnd(stringId, "#")); } catch (URISyntaxException e) { throw new IllegalArgumentException("Bad path: " + stringId); } } if (selfReferenceWithoutParentFile(parent, path) || substringBefore(stringId, "#").isEmpty()) { JsonNode parentContent = parent.getParent().getContent(); Schema schema = new Schema(id, fragmentResolver.resolve(parentContent, path, refFragmentPathDelimiters), parent.getParent()); schemas.put(id, schema); return schema; } return create(id, refFragmentPathDelimiters); }
java
@SuppressWarnings("PMD.UselessParentheses") public Schema create(Schema parent, String path, String refFragmentPathDelimiters) { if (!path.equals("#")) { // if path is an empty string then resolving it below results in jumping up a level. e.g. "/path/to/file.json" becomes "/path/to" path = stripEnd(path, "#?&/"); } // encode the fragment for any funny characters if (path.contains("#")) { String pathExcludingFragment = substringBefore(path, "#"); String fragment = substringAfter(path, "#"); URI fragmentURI; try { fragmentURI = new URI(null, null, fragment); } catch (URISyntaxException e) { throw new IllegalArgumentException("Invalid fragment: " + fragment + " in path: " + path); } path = pathExcludingFragment + "#" + fragmentURI.getRawFragment(); } URI id = (parent == null || parent.getId() == null) ? URI.create(path) : parent.getId().resolve(path); String stringId = id.toString(); if (stringId.endsWith("#")) { try { id = new URI(stripEnd(stringId, "#")); } catch (URISyntaxException e) { throw new IllegalArgumentException("Bad path: " + stringId); } } if (selfReferenceWithoutParentFile(parent, path) || substringBefore(stringId, "#").isEmpty()) { JsonNode parentContent = parent.getParent().getContent(); Schema schema = new Schema(id, fragmentResolver.resolve(parentContent, path, refFragmentPathDelimiters), parent.getParent()); schemas.put(id, schema); return schema; } return create(id, refFragmentPathDelimiters); }
[ "@", "SuppressWarnings", "(", "\"PMD.UselessParentheses\"", ")", "public", "Schema", "create", "(", "Schema", "parent", ",", "String", "path", ",", "String", "refFragmentPathDelimiters", ")", "{", "if", "(", "!", "path", ".", "equals", "(", "\"#\"", ")", ")", "{", "// if path is an empty string then resolving it below results in jumping up a level. e.g. \"/path/to/file.json\" becomes \"/path/to\"", "path", "=", "stripEnd", "(", "path", ",", "\"#?&/\"", ")", ";", "}", "// encode the fragment for any funny characters", "if", "(", "path", ".", "contains", "(", "\"#\"", ")", ")", "{", "String", "pathExcludingFragment", "=", "substringBefore", "(", "path", ",", "\"#\"", ")", ";", "String", "fragment", "=", "substringAfter", "(", "path", ",", "\"#\"", ")", ";", "URI", "fragmentURI", ";", "try", "{", "fragmentURI", "=", "new", "URI", "(", "null", ",", "null", ",", "fragment", ")", ";", "}", "catch", "(", "URISyntaxException", "e", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Invalid fragment: \"", "+", "fragment", "+", "\" in path: \"", "+", "path", ")", ";", "}", "path", "=", "pathExcludingFragment", "+", "\"#\"", "+", "fragmentURI", ".", "getRawFragment", "(", ")", ";", "}", "URI", "id", "=", "(", "parent", "==", "null", "||", "parent", ".", "getId", "(", ")", "==", "null", ")", "?", "URI", ".", "create", "(", "path", ")", ":", "parent", ".", "getId", "(", ")", ".", "resolve", "(", "path", ")", ";", "String", "stringId", "=", "id", ".", "toString", "(", ")", ";", "if", "(", "stringId", ".", "endsWith", "(", "\"#\"", ")", ")", "{", "try", "{", "id", "=", "new", "URI", "(", "stripEnd", "(", "stringId", ",", "\"#\"", ")", ")", ";", "}", "catch", "(", "URISyntaxException", "e", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Bad path: \"", "+", "stringId", ")", ";", "}", "}", "if", "(", "selfReferenceWithoutParentFile", "(", "parent", ",", "path", ")", "||", "substringBefore", "(", "stringId", ",", "\"#\"", ")", ".", "isEmpty", "(", ")", ")", "{", "JsonNode", "parentContent", "=", "parent", ".", "getParent", "(", ")", ".", "getContent", "(", ")", ";", "Schema", "schema", "=", "new", "Schema", "(", "id", ",", "fragmentResolver", ".", "resolve", "(", "parentContent", ",", "path", ",", "refFragmentPathDelimiters", ")", ",", "parent", ".", "getParent", "(", ")", ")", ";", "schemas", ".", "put", "(", "id", ",", "schema", ")", ";", "return", "schema", ";", "}", "return", "create", "(", "id", ",", "refFragmentPathDelimiters", ")", ";", "}" ]
Create or look up a new schema using the given schema as a parent and the path as a relative reference. If a schema with the given parent and relative path is already known, then a reference to the original schema will be returned. @param parent the schema which is the parent of the schema to be created. @param path the relative path of this schema (will be used to create a complete URI by resolving this path against the parent schema's id) @param refFragmentPathDelimiters A string containing any characters that should act as path delimiters when resolving $ref fragments. @return a schema object containing the contents of the given path
[ "Create", "or", "look", "up", "a", "new", "schema", "using", "the", "given", "schema", "as", "a", "parent", "and", "the", "path", "as", "a", "relative", "reference", ".", "If", "a", "schema", "with", "the", "given", "parent", "and", "relative", "path", "is", "already", "known", "then", "a", "reference", "to", "the", "original", "schema", "will", "be", "returned", "." ]
0552b80db93214eb186e4ae45b40866cc1e7eb84
https://github.com/joelittlejohn/jsonschema2pojo/blob/0552b80db93214eb186e4ae45b40866cc1e7eb84/jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/SchemaStore.java#L93-L134
20,908
joelittlejohn/jsonschema2pojo
jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/TypeRule.java
TypeRule.getIntegerType
private JType getIntegerType(JCodeModel owner, JsonNode node, GenerationConfig config) { if (config.isUseBigIntegers()) { return unboxIfNecessary(owner.ref(BigInteger.class), config); } else if (config.isUseLongIntegers() || node.has("minimum") && node.get("minimum").isLong() || node.has("maximum") && node.get("maximum") .isLong()) { return unboxIfNecessary(owner.ref(Long.class), config); } else { return unboxIfNecessary(owner.ref(Integer.class), config); } }
java
private JType getIntegerType(JCodeModel owner, JsonNode node, GenerationConfig config) { if (config.isUseBigIntegers()) { return unboxIfNecessary(owner.ref(BigInteger.class), config); } else if (config.isUseLongIntegers() || node.has("minimum") && node.get("minimum").isLong() || node.has("maximum") && node.get("maximum") .isLong()) { return unboxIfNecessary(owner.ref(Long.class), config); } else { return unboxIfNecessary(owner.ref(Integer.class), config); } }
[ "private", "JType", "getIntegerType", "(", "JCodeModel", "owner", ",", "JsonNode", "node", ",", "GenerationConfig", "config", ")", "{", "if", "(", "config", ".", "isUseBigIntegers", "(", ")", ")", "{", "return", "unboxIfNecessary", "(", "owner", ".", "ref", "(", "BigInteger", ".", "class", ")", ",", "config", ")", ";", "}", "else", "if", "(", "config", ".", "isUseLongIntegers", "(", ")", "||", "node", ".", "has", "(", "\"minimum\"", ")", "&&", "node", ".", "get", "(", "\"minimum\"", ")", ".", "isLong", "(", ")", "||", "node", ".", "has", "(", "\"maximum\"", ")", "&&", "node", ".", "get", "(", "\"maximum\"", ")", ".", "isLong", "(", ")", ")", "{", "return", "unboxIfNecessary", "(", "owner", ".", "ref", "(", "Long", ".", "class", ")", ",", "config", ")", ";", "}", "else", "{", "return", "unboxIfNecessary", "(", "owner", ".", "ref", "(", "Integer", ".", "class", ")", ",", "config", ")", ";", "}", "}" ]
Returns the JType for an integer field. Handles type lookup and unboxing.
[ "Returns", "the", "JType", "for", "an", "integer", "field", ".", "Handles", "type", "lookup", "and", "unboxing", "." ]
0552b80db93214eb186e4ae45b40866cc1e7eb84
https://github.com/joelittlejohn/jsonschema2pojo/blob/0552b80db93214eb186e4ae45b40866cc1e7eb84/jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/TypeRule.java#L146-L157
20,909
joelittlejohn/jsonschema2pojo
jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/TypeRule.java
TypeRule.getNumberType
private JType getNumberType(JCodeModel owner, GenerationConfig config) { if (config.isUseBigDecimals()) { return unboxIfNecessary(owner.ref(BigDecimal.class), config); } else if (config.isUseDoubleNumbers()) { return unboxIfNecessary(owner.ref(Double.class), config); } else { return unboxIfNecessary(owner.ref(Float.class), config); } }
java
private JType getNumberType(JCodeModel owner, GenerationConfig config) { if (config.isUseBigDecimals()) { return unboxIfNecessary(owner.ref(BigDecimal.class), config); } else if (config.isUseDoubleNumbers()) { return unboxIfNecessary(owner.ref(Double.class), config); } else { return unboxIfNecessary(owner.ref(Float.class), config); } }
[ "private", "JType", "getNumberType", "(", "JCodeModel", "owner", ",", "GenerationConfig", "config", ")", "{", "if", "(", "config", ".", "isUseBigDecimals", "(", ")", ")", "{", "return", "unboxIfNecessary", "(", "owner", ".", "ref", "(", "BigDecimal", ".", "class", ")", ",", "config", ")", ";", "}", "else", "if", "(", "config", ".", "isUseDoubleNumbers", "(", ")", ")", "{", "return", "unboxIfNecessary", "(", "owner", ".", "ref", "(", "Double", ".", "class", ")", ",", "config", ")", ";", "}", "else", "{", "return", "unboxIfNecessary", "(", "owner", ".", "ref", "(", "Float", ".", "class", ")", ",", "config", ")", ";", "}", "}" ]
Returns the JType for a number field. Handles type lookup and unboxing.
[ "Returns", "the", "JType", "for", "a", "number", "field", ".", "Handles", "type", "lookup", "and", "unboxing", "." ]
0552b80db93214eb186e4ae45b40866cc1e7eb84
https://github.com/joelittlejohn/jsonschema2pojo/blob/0552b80db93214eb186e4ae45b40866cc1e7eb84/jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/TypeRule.java#L162-L172
20,910
joelittlejohn/jsonschema2pojo
jsonschema2pojo-ant/src/main/java/org/jsonschema2pojo/ant/Jsonschema2PojoTask.java
Jsonschema2PojoTask.setCustomAnnotator
@SuppressWarnings("unchecked") public void setCustomAnnotator(String customAnnotator) { if (isNotBlank(customAnnotator)) { try { this.customAnnotator = (Class<? extends Annotator>) Class.forName(customAnnotator); } catch (ClassNotFoundException e) { throw new IllegalArgumentException(e); } } else { this.customAnnotator = NoopAnnotator.class; } }
java
@SuppressWarnings("unchecked") public void setCustomAnnotator(String customAnnotator) { if (isNotBlank(customAnnotator)) { try { this.customAnnotator = (Class<? extends Annotator>) Class.forName(customAnnotator); } catch (ClassNotFoundException e) { throw new IllegalArgumentException(e); } } else { this.customAnnotator = NoopAnnotator.class; } }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "void", "setCustomAnnotator", "(", "String", "customAnnotator", ")", "{", "if", "(", "isNotBlank", "(", "customAnnotator", ")", ")", "{", "try", "{", "this", ".", "customAnnotator", "=", "(", "Class", "<", "?", "extends", "Annotator", ">", ")", "Class", ".", "forName", "(", "customAnnotator", ")", ";", "}", "catch", "(", "ClassNotFoundException", "e", ")", "{", "throw", "new", "IllegalArgumentException", "(", "e", ")", ";", "}", "}", "else", "{", "this", ".", "customAnnotator", "=", "NoopAnnotator", ".", "class", ";", "}", "}" ]
Sets the 'customAnnotator' property of this class @param customAnnotator A custom annotator to use to annotate the generated types
[ "Sets", "the", "customAnnotator", "property", "of", "this", "class" ]
0552b80db93214eb186e4ae45b40866cc1e7eb84
https://github.com/joelittlejohn/jsonschema2pojo/blob/0552b80db93214eb186e4ae45b40866cc1e7eb84/jsonschema2pojo-ant/src/main/java/org/jsonschema2pojo/ant/Jsonschema2PojoTask.java#L504-L515
20,911
joelittlejohn/jsonschema2pojo
jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/ConstructorRule.java
ConstructorRule.getSuperTypeConstructorPropertiesRecursive
private LinkedHashSet<String> getSuperTypeConstructorPropertiesRecursive(JsonNode node, Schema schema, boolean onlyRequired) { Schema superTypeSchema = reflectionHelper.getSuperSchema(node, schema, true); if (superTypeSchema == null) { return new LinkedHashSet<>(); } JsonNode superSchemaNode = superTypeSchema.getContent(); LinkedHashSet<String> rtn = getConstructorProperties(superSchemaNode, onlyRequired); rtn.addAll(getSuperTypeConstructorPropertiesRecursive(superSchemaNode, superTypeSchema, onlyRequired)); return rtn; }
java
private LinkedHashSet<String> getSuperTypeConstructorPropertiesRecursive(JsonNode node, Schema schema, boolean onlyRequired) { Schema superTypeSchema = reflectionHelper.getSuperSchema(node, schema, true); if (superTypeSchema == null) { return new LinkedHashSet<>(); } JsonNode superSchemaNode = superTypeSchema.getContent(); LinkedHashSet<String> rtn = getConstructorProperties(superSchemaNode, onlyRequired); rtn.addAll(getSuperTypeConstructorPropertiesRecursive(superSchemaNode, superTypeSchema, onlyRequired)); return rtn; }
[ "private", "LinkedHashSet", "<", "String", ">", "getSuperTypeConstructorPropertiesRecursive", "(", "JsonNode", "node", ",", "Schema", "schema", ",", "boolean", "onlyRequired", ")", "{", "Schema", "superTypeSchema", "=", "reflectionHelper", ".", "getSuperSchema", "(", "node", ",", "schema", ",", "true", ")", ";", "if", "(", "superTypeSchema", "==", "null", ")", "{", "return", "new", "LinkedHashSet", "<>", "(", ")", ";", "}", "JsonNode", "superSchemaNode", "=", "superTypeSchema", ".", "getContent", "(", ")", ";", "LinkedHashSet", "<", "String", ">", "rtn", "=", "getConstructorProperties", "(", "superSchemaNode", ",", "onlyRequired", ")", ";", "rtn", ".", "addAll", "(", "getSuperTypeConstructorPropertiesRecursive", "(", "superSchemaNode", ",", "superTypeSchema", ",", "onlyRequired", ")", ")", ";", "return", "rtn", ";", "}" ]
Recursive, walks the schema tree and assembles a list of all properties of this schema's super schemas
[ "Recursive", "walks", "the", "schema", "tree", "and", "assembles", "a", "list", "of", "all", "properties", "of", "this", "schema", "s", "super", "schemas" ]
0552b80db93214eb186e4ae45b40866cc1e7eb84
https://github.com/joelittlejohn/jsonschema2pojo/blob/0552b80db93214eb186e4ae45b40866cc1e7eb84/jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/ConstructorRule.java#L133-L146
20,912
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/tools/SunMoonCalculator.java
SunMoonCalculator.getDateAsString
public static String getDateAsString(final double JULIAN_DAY, final int TIMEZONE_OFFSET) throws Exception { if (JULIAN_DAY == -1) return "NO RISE/SET/TRANSIT FOR THIS OBSERVER/DATE"; int date[] = SunMoonCalculator.getDate(JULIAN_DAY); return date[0] + "/" + date[1] + "/" + date[2] + " " + ((date[3] + TIMEZONE_OFFSET) % 24) + ":" + date[4] + ":" + date[5] + " UT"; }
java
public static String getDateAsString(final double JULIAN_DAY, final int TIMEZONE_OFFSET) throws Exception { if (JULIAN_DAY == -1) return "NO RISE/SET/TRANSIT FOR THIS OBSERVER/DATE"; int date[] = SunMoonCalculator.getDate(JULIAN_DAY); return date[0] + "/" + date[1] + "/" + date[2] + " " + ((date[3] + TIMEZONE_OFFSET) % 24) + ":" + date[4] + ":" + date[5] + " UT"; }
[ "public", "static", "String", "getDateAsString", "(", "final", "double", "JULIAN_DAY", ",", "final", "int", "TIMEZONE_OFFSET", ")", "throws", "Exception", "{", "if", "(", "JULIAN_DAY", "==", "-", "1", ")", "return", "\"NO RISE/SET/TRANSIT FOR THIS OBSERVER/DATE\"", ";", "int", "date", "[", "]", "=", "SunMoonCalculator", ".", "getDate", "(", "JULIAN_DAY", ")", ";", "return", "date", "[", "0", "]", "+", "\"/\"", "+", "date", "[", "1", "]", "+", "\"/\"", "+", "date", "[", "2", "]", "+", "\" \"", "+", "(", "(", "date", "[", "3", "]", "+", "TIMEZONE_OFFSET", ")", "%", "24", ")", "+", "\":\"", "+", "date", "[", "4", "]", "+", "\":\"", "+", "date", "[", "5", "]", "+", "\" UT\"", ";", "}" ]
Returns a date as a string. @param JULIAN_DAY The Juliand day. @return The String. @throws Exception If the date does not exists.
[ "Returns", "a", "date", "as", "a", "string", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/tools/SunMoonCalculator.java#L215-L220
20,913
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/tools/SunMoonCalculator.java
SunMoonCalculator.calcSunAndMoon
public void calcSunAndMoon() { double jd = this.jd_UT; // First the Sun double out[] = doCalc(getSun()); sunAz = out[0]; sunEl = out[1]; sunrise = out[2]; sunset = out[3]; sunTransit = out[4]; sunTransitElev = out[5]; sunDist = out[8]; double sa = sanomaly, sl = slongitude; int niter = 3; // Number of iterations to get accurate rise/set/transit times sunrise = obtainAccurateRiseSetTransit(sunrise, 2, niter, true); sunset = obtainAccurateRiseSetTransit(sunset, 3, niter, true); sunTransit = obtainAccurateRiseSetTransit(sunTransit, 4, niter, true); if (sunTransit == -1) { sunTransitElev = 0; } else { // Update Sun's maximum elevation setUTDate(sunTransit); out = doCalc(getSun()); sunTransitElev = out[5]; } // Now Moon setUTDate(jd); sanomaly = sa; slongitude = sl; out = doCalc(getMoon()); moonAz = out[0]; moonEl = out[1]; moonRise = out[2]; moonSet = out[3]; moonTransit = out[4]; moonTransitElev = out[5]; moonDist = out[8]; double ma = moonAge; niter = 5; // Number of iterations to get accurate rise/set/transit times moonRise = obtainAccurateRiseSetTransit(moonRise, 2, niter, false); moonSet = obtainAccurateRiseSetTransit(moonSet, 3, niter, false); moonTransit = obtainAccurateRiseSetTransit(moonTransit, 4, niter, false); if (moonTransit == -1) { moonTransitElev = 0; } else { // Update Moon's maximum elevation setUTDate(moonTransit); getSun(); out = doCalc(getMoon()); moonTransitElev = out[5]; } setUTDate(jd); sanomaly = sa; slongitude = sl; moonAge = ma; }
java
public void calcSunAndMoon() { double jd = this.jd_UT; // First the Sun double out[] = doCalc(getSun()); sunAz = out[0]; sunEl = out[1]; sunrise = out[2]; sunset = out[3]; sunTransit = out[4]; sunTransitElev = out[5]; sunDist = out[8]; double sa = sanomaly, sl = slongitude; int niter = 3; // Number of iterations to get accurate rise/set/transit times sunrise = obtainAccurateRiseSetTransit(sunrise, 2, niter, true); sunset = obtainAccurateRiseSetTransit(sunset, 3, niter, true); sunTransit = obtainAccurateRiseSetTransit(sunTransit, 4, niter, true); if (sunTransit == -1) { sunTransitElev = 0; } else { // Update Sun's maximum elevation setUTDate(sunTransit); out = doCalc(getSun()); sunTransitElev = out[5]; } // Now Moon setUTDate(jd); sanomaly = sa; slongitude = sl; out = doCalc(getMoon()); moonAz = out[0]; moonEl = out[1]; moonRise = out[2]; moonSet = out[3]; moonTransit = out[4]; moonTransitElev = out[5]; moonDist = out[8]; double ma = moonAge; niter = 5; // Number of iterations to get accurate rise/set/transit times moonRise = obtainAccurateRiseSetTransit(moonRise, 2, niter, false); moonSet = obtainAccurateRiseSetTransit(moonSet, 3, niter, false); moonTransit = obtainAccurateRiseSetTransit(moonTransit, 4, niter, false); if (moonTransit == -1) { moonTransitElev = 0; } else { // Update Moon's maximum elevation setUTDate(moonTransit); getSun(); out = doCalc(getMoon()); moonTransitElev = out[5]; } setUTDate(jd); sanomaly = sa; slongitude = sl; moonAge = ma; }
[ "public", "void", "calcSunAndMoon", "(", ")", "{", "double", "jd", "=", "this", ".", "jd_UT", ";", "// First the Sun", "double", "out", "[", "]", "=", "doCalc", "(", "getSun", "(", ")", ")", ";", "sunAz", "=", "out", "[", "0", "]", ";", "sunEl", "=", "out", "[", "1", "]", ";", "sunrise", "=", "out", "[", "2", "]", ";", "sunset", "=", "out", "[", "3", "]", ";", "sunTransit", "=", "out", "[", "4", "]", ";", "sunTransitElev", "=", "out", "[", "5", "]", ";", "sunDist", "=", "out", "[", "8", "]", ";", "double", "sa", "=", "sanomaly", ",", "sl", "=", "slongitude", ";", "int", "niter", "=", "3", ";", "// Number of iterations to get accurate rise/set/transit times", "sunrise", "=", "obtainAccurateRiseSetTransit", "(", "sunrise", ",", "2", ",", "niter", ",", "true", ")", ";", "sunset", "=", "obtainAccurateRiseSetTransit", "(", "sunset", ",", "3", ",", "niter", ",", "true", ")", ";", "sunTransit", "=", "obtainAccurateRiseSetTransit", "(", "sunTransit", ",", "4", ",", "niter", ",", "true", ")", ";", "if", "(", "sunTransit", "==", "-", "1", ")", "{", "sunTransitElev", "=", "0", ";", "}", "else", "{", "// Update Sun's maximum elevation", "setUTDate", "(", "sunTransit", ")", ";", "out", "=", "doCalc", "(", "getSun", "(", ")", ")", ";", "sunTransitElev", "=", "out", "[", "5", "]", ";", "}", "// Now Moon", "setUTDate", "(", "jd", ")", ";", "sanomaly", "=", "sa", ";", "slongitude", "=", "sl", ";", "out", "=", "doCalc", "(", "getMoon", "(", ")", ")", ";", "moonAz", "=", "out", "[", "0", "]", ";", "moonEl", "=", "out", "[", "1", "]", ";", "moonRise", "=", "out", "[", "2", "]", ";", "moonSet", "=", "out", "[", "3", "]", ";", "moonTransit", "=", "out", "[", "4", "]", ";", "moonTransitElev", "=", "out", "[", "5", "]", ";", "moonDist", "=", "out", "[", "8", "]", ";", "double", "ma", "=", "moonAge", ";", "niter", "=", "5", ";", "// Number of iterations to get accurate rise/set/transit times", "moonRise", "=", "obtainAccurateRiseSetTransit", "(", "moonRise", ",", "2", ",", "niter", ",", "false", ")", ";", "moonSet", "=", "obtainAccurateRiseSetTransit", "(", "moonSet", ",", "3", ",", "niter", ",", "false", ")", ";", "moonTransit", "=", "obtainAccurateRiseSetTransit", "(", "moonTransit", ",", "4", ",", "niter", ",", "false", ")", ";", "if", "(", "moonTransit", "==", "-", "1", ")", "{", "moonTransitElev", "=", "0", ";", "}", "else", "{", "// Update Moon's maximum elevation", "setUTDate", "(", "moonTransit", ")", ";", "getSun", "(", ")", ";", "out", "=", "doCalc", "(", "getMoon", "(", ")", ")", ";", "moonTransitElev", "=", "out", "[", "5", "]", ";", "}", "setUTDate", "(", "jd", ")", ";", "sanomaly", "=", "sa", ";", "slongitude", "=", "sl", ";", "moonAge", "=", "ma", ";", "}" ]
Calculates everything for the Sun and the Moon.
[ "Calculates", "everything", "for", "the", "Sun", "and", "the", "Moon", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/tools/SunMoonCalculator.java#L304-L362
20,914
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setReferenceValue
public void setReferenceValue(final double VALUE) { if (null == referenceValue) { _referenceValue = VALUE; fireTileEvent(REDRAW_EVENT); } else { referenceValue.set(VALUE); } }
java
public void setReferenceValue(final double VALUE) { if (null == referenceValue) { _referenceValue = VALUE; fireTileEvent(REDRAW_EVENT); } else { referenceValue.set(VALUE); } }
[ "public", "void", "setReferenceValue", "(", "final", "double", "VALUE", ")", "{", "if", "(", "null", "==", "referenceValue", ")", "{", "_referenceValue", "=", "VALUE", ";", "fireTileEvent", "(", "REDRAW_EVENT", ")", ";", "}", "else", "{", "referenceValue", ".", "set", "(", "VALUE", ")", ";", "}", "}" ]
Defines the reference value that will be used in the HighLowTileSkin @param VALUE
[ "Defines", "the", "reference", "value", "that", "will", "be", "used", "in", "the", "HighLowTileSkin" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L1193-L1200
20,915
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setTitle
public void setTitle(final String TITLE) { if (null == title) { _title = null == TITLE ? "" : TITLE; fireTileEvent(VISIBILITY_EVENT); fireTileEvent(REDRAW_EVENT); } else { title.set(TITLE); } }
java
public void setTitle(final String TITLE) { if (null == title) { _title = null == TITLE ? "" : TITLE; fireTileEvent(VISIBILITY_EVENT); fireTileEvent(REDRAW_EVENT); } else { title.set(TITLE); } }
[ "public", "void", "setTitle", "(", "final", "String", "TITLE", ")", "{", "if", "(", "null", "==", "title", ")", "{", "_title", "=", "null", "==", "TITLE", "?", "\"\"", ":", "TITLE", ";", "fireTileEvent", "(", "VISIBILITY_EVENT", ")", ";", "fireTileEvent", "(", "REDRAW_EVENT", ")", ";", "}", "else", "{", "title", ".", "set", "(", "TITLE", ")", ";", "}", "}" ]
Sets the title of the gauge. This title will only be visible if it is not empty. @param TITLE
[ "Sets", "the", "title", "of", "the", "gauge", ".", "This", "title", "will", "only", "be", "visible", "if", "it", "is", "not", "empty", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L1256-L1264
20,916
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setTitleAlignment
public void setTitleAlignment(final TextAlignment ALIGNMENT) { if (null == titleAlignment) { _titleAlignment = ALIGNMENT; fireTileEvent(RESIZE_EVENT); } else { titleAlignment.set(ALIGNMENT); } }
java
public void setTitleAlignment(final TextAlignment ALIGNMENT) { if (null == titleAlignment) { _titleAlignment = ALIGNMENT; fireTileEvent(RESIZE_EVENT); } else { titleAlignment.set(ALIGNMENT); } }
[ "public", "void", "setTitleAlignment", "(", "final", "TextAlignment", "ALIGNMENT", ")", "{", "if", "(", "null", "==", "titleAlignment", ")", "{", "_titleAlignment", "=", "ALIGNMENT", ";", "fireTileEvent", "(", "RESIZE_EVENT", ")", ";", "}", "else", "{", "titleAlignment", ".", "set", "(", "ALIGNMENT", ")", ";", "}", "}" ]
Defines the alignment that will be used to align the title in the Tile. Keep in mind that this property will not be used by every skin. @param ALIGNMENT
[ "Defines", "the", "alignment", "that", "will", "be", "used", "to", "align", "the", "title", "in", "the", "Tile", ".", "Keep", "in", "mind", "that", "this", "property", "will", "not", "be", "used", "by", "every", "skin", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L1294-L1301
20,917
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setDescription
public void setDescription(final String DESCRIPTION) { if (null == description) { _description = DESCRIPTION; fireTileEvent(VISIBILITY_EVENT); fireTileEvent(REDRAW_EVENT); } else { description.set(DESCRIPTION); } }
java
public void setDescription(final String DESCRIPTION) { if (null == description) { _description = DESCRIPTION; fireTileEvent(VISIBILITY_EVENT); fireTileEvent(REDRAW_EVENT); } else { description.set(DESCRIPTION); } }
[ "public", "void", "setDescription", "(", "final", "String", "DESCRIPTION", ")", "{", "if", "(", "null", "==", "description", ")", "{", "_description", "=", "DESCRIPTION", ";", "fireTileEvent", "(", "VISIBILITY_EVENT", ")", ";", "fireTileEvent", "(", "REDRAW_EVENT", ")", ";", "}", "else", "{", "description", ".", "set", "(", "DESCRIPTION", ")", ";", "}", "}" ]
Sets the description text of the gauge. This description text will usually only be visible if it is not empty. @param DESCRIPTION
[ "Sets", "the", "description", "text", "of", "the", "gauge", ".", "This", "description", "text", "will", "usually", "only", "be", "visible", "if", "it", "is", "not", "empty", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L1327-L1335
20,918
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setUnit
public void setUnit(final String UNIT) { if (null == unit) { _unit = UNIT; fireTileEvent(VISIBILITY_EVENT); fireTileEvent(REDRAW_EVENT); } else { unit.set(UNIT); } }
java
public void setUnit(final String UNIT) { if (null == unit) { _unit = UNIT; fireTileEvent(VISIBILITY_EVENT); fireTileEvent(REDRAW_EVENT); } else { unit.set(UNIT); } }
[ "public", "void", "setUnit", "(", "final", "String", "UNIT", ")", "{", "if", "(", "null", "==", "unit", ")", "{", "_unit", "=", "UNIT", ";", "fireTileEvent", "(", "VISIBILITY_EVENT", ")", ";", "fireTileEvent", "(", "REDRAW_EVENT", ")", ";", "}", "else", "{", "unit", ".", "set", "(", "UNIT", ")", ";", "}", "}" ]
Sets the unit of the gauge. This unit will usually only be visible if it is not empty. @param UNIT
[ "Sets", "the", "unit", "of", "the", "gauge", ".", "This", "unit", "will", "usually", "only", "be", "visible", "if", "it", "is", "not", "empty", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L1394-L1402
20,919
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setFlipText
public void setFlipText(final String TEXT) { if (null == flipText) { _flipText = TEXT; if (!oldFlipText.equals(_flipText)) { fireTileEvent(FLIP_START_EVENT); } oldFlipText = _flipText; } else { flipText.set(TEXT); } }
java
public void setFlipText(final String TEXT) { if (null == flipText) { _flipText = TEXT; if (!oldFlipText.equals(_flipText)) { fireTileEvent(FLIP_START_EVENT); } oldFlipText = _flipText; } else { flipText.set(TEXT); } }
[ "public", "void", "setFlipText", "(", "final", "String", "TEXT", ")", "{", "if", "(", "null", "==", "flipText", ")", "{", "_flipText", "=", "TEXT", ";", "if", "(", "!", "oldFlipText", ".", "equals", "(", "_flipText", ")", ")", "{", "fireTileEvent", "(", "FLIP_START_EVENT", ")", ";", "}", "oldFlipText", "=", "_flipText", ";", "}", "else", "{", "flipText", ".", "set", "(", "TEXT", ")", ";", "}", "}" ]
Defines the text that will be used to visualize the FlipTileSkin @param TEXT
[ "Defines", "the", "text", "that", "will", "be", "used", "to", "visualize", "the", "FlipTileSkin" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L1424-L1432
20,920
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setActive
public void setActive(final boolean SELECTED) { if (null == active) { _active = SELECTED; fireTileEvent(REDRAW_EVENT); } else { active.set(SELECTED); } }
java
public void setActive(final boolean SELECTED) { if (null == active) { _active = SELECTED; fireTileEvent(REDRAW_EVENT); } else { active.set(SELECTED); } }
[ "public", "void", "setActive", "(", "final", "boolean", "SELECTED", ")", "{", "if", "(", "null", "==", "active", ")", "{", "_active", "=", "SELECTED", ";", "fireTileEvent", "(", "REDRAW_EVENT", ")", ";", "}", "else", "{", "active", ".", "set", "(", "SELECTED", ")", ";", "}", "}" ]
Defines if the switch in the SwitchTileSkin is active @param SELECTED
[ "Defines", "if", "the", "switch", "in", "the", "SwitchTileSkin", "is", "active" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L1457-L1464
20,921
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setDuration
public void setDuration(final LocalTime DURATION) { if (null == duration) { _duration = DURATION; fireTileEvent(REDRAW_EVENT); } else { duration.set(DURATION); } }
java
public void setDuration(final LocalTime DURATION) { if (null == duration) { _duration = DURATION; fireTileEvent(REDRAW_EVENT); } else { duration.set(DURATION); } }
[ "public", "void", "setDuration", "(", "final", "LocalTime", "DURATION", ")", "{", "if", "(", "null", "==", "duration", ")", "{", "_duration", "=", "DURATION", ";", "fireTileEvent", "(", "REDRAW_EVENT", ")", ";", "}", "else", "{", "duration", ".", "set", "(", "DURATION", ")", ";", "}", "}" ]
Defines a duration that is used in the TimeTileSkin @param DURATION
[ "Defines", "a", "duration", "that", "is", "used", "in", "the", "TimeTileSkin" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L1578-L1585
20,922
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setForegroundBaseColor
public void setForegroundBaseColor(final Color COLOR) { if (null == titleColor) { _titleColor = COLOR; } else { titleColor.set(COLOR); } if (null == descriptionColor) { _descriptionColor = COLOR; } else { descriptionColor.set(COLOR); } if (null == unitColor) { _unitColor = COLOR; } else { unitColor.set(COLOR); } if (null == valueColor) { _valueColor = COLOR; } else { valueColor.set(COLOR); } if (null == textColor) { _textColor = COLOR; } else { textColor.set(COLOR); } if (null == foregroundColor) { _foregroundColor = COLOR; } else { foregroundColor.set(COLOR); } fireTileEvent(REDRAW_EVENT); }
java
public void setForegroundBaseColor(final Color COLOR) { if (null == titleColor) { _titleColor = COLOR; } else { titleColor.set(COLOR); } if (null == descriptionColor) { _descriptionColor = COLOR; } else { descriptionColor.set(COLOR); } if (null == unitColor) { _unitColor = COLOR; } else { unitColor.set(COLOR); } if (null == valueColor) { _valueColor = COLOR; } else { valueColor.set(COLOR); } if (null == textColor) { _textColor = COLOR; } else { textColor.set(COLOR); } if (null == foregroundColor) { _foregroundColor = COLOR; } else { foregroundColor.set(COLOR); } fireTileEvent(REDRAW_EVENT); }
[ "public", "void", "setForegroundBaseColor", "(", "final", "Color", "COLOR", ")", "{", "if", "(", "null", "==", "titleColor", ")", "{", "_titleColor", "=", "COLOR", ";", "}", "else", "{", "titleColor", ".", "set", "(", "COLOR", ")", ";", "}", "if", "(", "null", "==", "descriptionColor", ")", "{", "_descriptionColor", "=", "COLOR", ";", "}", "else", "{", "descriptionColor", ".", "set", "(", "COLOR", ")", ";", "}", "if", "(", "null", "==", "unitColor", ")", "{", "_unitColor", "=", "COLOR", ";", "}", "else", "{", "unitColor", ".", "set", "(", "COLOR", ")", ";", "}", "if", "(", "null", "==", "valueColor", ")", "{", "_valueColor", "=", "COLOR", ";", "}", "else", "{", "valueColor", ".", "set", "(", "COLOR", ")", ";", "}", "if", "(", "null", "==", "textColor", ")", "{", "_textColor", "=", "COLOR", ";", "}", "else", "{", "textColor", ".", "set", "(", "COLOR", ")", ";", "}", "if", "(", "null", "==", "foregroundColor", ")", "{", "_foregroundColor", "=", "COLOR", ";", "}", "else", "{", "foregroundColor", ".", "set", "(", "COLOR", ")", ";", "}", "fireTileEvent", "(", "REDRAW_EVENT", ")", ";", "}" ]
A convenient method to set the color of foreground elements like title, description, unit, value, tickLabel and tickMark to the given Color. @param COLOR
[ "A", "convenient", "method", "to", "set", "the", "color", "of", "foreground", "elements", "like", "title", "description", "unit", "value", "tickLabel", "and", "tickMark", "to", "the", "given", "Color", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L1979-L1987
20,923
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setTextSize
public void setTextSize(final TextSize SIZE) { if (null == textSize) { _textSize = SIZE; fireTileEvent(REDRAW_EVENT); } else { textSize.set(SIZE); } }
java
public void setTextSize(final TextSize SIZE) { if (null == textSize) { _textSize = SIZE; fireTileEvent(REDRAW_EVENT); } else { textSize.set(SIZE); } }
[ "public", "void", "setTextSize", "(", "final", "TextSize", "SIZE", ")", "{", "if", "(", "null", "==", "textSize", ")", "{", "_textSize", "=", "SIZE", ";", "fireTileEvent", "(", "REDRAW_EVENT", ")", ";", "}", "else", "{", "textSize", ".", "set", "(", "SIZE", ")", ";", "}", "}" ]
Defines the text size that will be used for the title, subtitle and text in the different skins. @param SIZE
[ "Defines", "the", "text", "size", "that", "will", "be", "used", "for", "the", "title", "subtitle", "and", "text", "in", "the", "different", "skins", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L2002-L2009
20,924
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setRoundedCorners
public void setRoundedCorners(final boolean ROUNDED) { if (null == roundedCorners) { _roundedCorners = ROUNDED; fireTileEvent(REDRAW_EVENT); } else { roundedCorners.set(ROUNDED); } }
java
public void setRoundedCorners(final boolean ROUNDED) { if (null == roundedCorners) { _roundedCorners = ROUNDED; fireTileEvent(REDRAW_EVENT); } else { roundedCorners.set(ROUNDED); } }
[ "public", "void", "setRoundedCorners", "(", "final", "boolean", "ROUNDED", ")", "{", "if", "(", "null", "==", "roundedCorners", ")", "{", "_roundedCorners", "=", "ROUNDED", ";", "fireTileEvent", "(", "REDRAW_EVENT", ")", ";", "}", "else", "{", "roundedCorners", ".", "set", "(", "ROUNDED", ")", ";", "}", "}" ]
Switches the corners of the Tiles between rounded and rectangular @param ROUNDED
[ "Switches", "the", "corners", "of", "the", "Tiles", "between", "rounded", "and", "rectangular" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L2030-L2037
20,925
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setForegroundColor
public void setForegroundColor(final Color COLOR) { if (null == foregroundColor) { _foregroundColor = COLOR; fireTileEvent(REDRAW_EVENT); } else { foregroundColor.set(COLOR); } }
java
public void setForegroundColor(final Color COLOR) { if (null == foregroundColor) { _foregroundColor = COLOR; fireTileEvent(REDRAW_EVENT); } else { foregroundColor.set(COLOR); } }
[ "public", "void", "setForegroundColor", "(", "final", "Color", "COLOR", ")", "{", "if", "(", "null", "==", "foregroundColor", ")", "{", "_foregroundColor", "=", "COLOR", ";", "fireTileEvent", "(", "REDRAW_EVENT", ")", ";", "}", "else", "{", "foregroundColor", ".", "set", "(", "COLOR", ")", ";", "}", "}" ]
Defines the Paint object that will be used to fill the gauge foreground. @param COLOR
[ "Defines", "the", "Paint", "object", "that", "will", "be", "used", "to", "fill", "the", "gauge", "foreground", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L2316-L2323
20,926
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setBackgroundColor
public void setBackgroundColor(final Color COLOR) { if (null == backgroundColor) { _backgroundColor = COLOR; fireTileEvent(REDRAW_EVENT); } else { backgroundColor.set(COLOR); } }
java
public void setBackgroundColor(final Color COLOR) { if (null == backgroundColor) { _backgroundColor = COLOR; fireTileEvent(REDRAW_EVENT); } else { backgroundColor.set(COLOR); } }
[ "public", "void", "setBackgroundColor", "(", "final", "Color", "COLOR", ")", "{", "if", "(", "null", "==", "backgroundColor", ")", "{", "_backgroundColor", "=", "COLOR", ";", "fireTileEvent", "(", "REDRAW_EVENT", ")", ";", "}", "else", "{", "backgroundColor", ".", "set", "(", "COLOR", ")", ";", "}", "}" ]
Defines the Paint object that will be used to fill the gauge background. @param COLOR
[ "Defines", "the", "Paint", "object", "that", "will", "be", "used", "to", "fill", "the", "gauge", "background", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L2348-L2355
20,927
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setBorderColor
public void setBorderColor(final Color PAINT) { if (null == borderColor) { _borderColor = PAINT; fireTileEvent(REDRAW_EVENT); } else { borderColor.set(PAINT); } }
java
public void setBorderColor(final Color PAINT) { if (null == borderColor) { _borderColor = PAINT; fireTileEvent(REDRAW_EVENT); } else { borderColor.set(PAINT); } }
[ "public", "void", "setBorderColor", "(", "final", "Color", "PAINT", ")", "{", "if", "(", "null", "==", "borderColor", ")", "{", "_borderColor", "=", "PAINT", ";", "fireTileEvent", "(", "REDRAW_EVENT", ")", ";", "}", "else", "{", "borderColor", ".", "set", "(", "PAINT", ")", ";", "}", "}" ]
Defines the Paint object that will be used to draw the border of the gauge. @param PAINT
[ "Defines", "the", "Paint", "object", "that", "will", "be", "used", "to", "draw", "the", "border", "of", "the", "gauge", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L2380-L2387
20,928
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setBorderWidth
public void setBorderWidth(final double WIDTH) { if (null == borderWidth) { _borderWidth = clamp(0.0, 50.0, WIDTH); fireTileEvent(REDRAW_EVENT); } else { borderWidth.set(WIDTH); } }
java
public void setBorderWidth(final double WIDTH) { if (null == borderWidth) { _borderWidth = clamp(0.0, 50.0, WIDTH); fireTileEvent(REDRAW_EVENT); } else { borderWidth.set(WIDTH); } }
[ "public", "void", "setBorderWidth", "(", "final", "double", "WIDTH", ")", "{", "if", "(", "null", "==", "borderWidth", ")", "{", "_borderWidth", "=", "clamp", "(", "0.0", ",", "50.0", ",", "WIDTH", ")", ";", "fireTileEvent", "(", "REDRAW_EVENT", ")", ";", "}", "else", "{", "borderWidth", ".", "set", "(", "WIDTH", ")", ";", "}", "}" ]
Defines the width in pixels that will be used to draw the border of the gauge. The value will be clamped between 0 and 50 pixels. @param WIDTH
[ "Defines", "the", "width", "in", "pixels", "that", "will", "be", "used", "to", "draw", "the", "border", "of", "the", "gauge", ".", "The", "value", "will", "be", "clamped", "between", "0", "and", "50", "pixels", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L2413-L2420
20,929
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setKnobColor
public void setKnobColor(final Color COLOR) { if (null == knobColor) { _knobColor = COLOR; fireTileEvent(RESIZE_EVENT); } else { knobColor.set(COLOR); } }
java
public void setKnobColor(final Color COLOR) { if (null == knobColor) { _knobColor = COLOR; fireTileEvent(RESIZE_EVENT); } else { knobColor.set(COLOR); } }
[ "public", "void", "setKnobColor", "(", "final", "Color", "COLOR", ")", "{", "if", "(", "null", "==", "knobColor", ")", "{", "_knobColor", "=", "COLOR", ";", "fireTileEvent", "(", "RESIZE_EVENT", ")", ";", "}", "else", "{", "knobColor", ".", "set", "(", "COLOR", ")", ";", "}", "}" ]
Defines the color that will be used to colorize the knob of the radial gauges. @param COLOR
[ "Defines", "the", "color", "that", "will", "be", "used", "to", "colorize", "the", "knob", "of", "the", "radial", "gauges", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L2449-L2456
20,930
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setTickLabelDecimals
public void setTickLabelDecimals(final int DECIMALS) { if (null == tickLabelDecimals) { _tickLabelDecimals = clamp(0, MAX_NO_OF_DECIMALS, DECIMALS); fireTileEvent(REDRAW_EVENT); } else { tickLabelDecimals.set(DECIMALS); } }
java
public void setTickLabelDecimals(final int DECIMALS) { if (null == tickLabelDecimals) { _tickLabelDecimals = clamp(0, MAX_NO_OF_DECIMALS, DECIMALS); fireTileEvent(REDRAW_EVENT); } else { tickLabelDecimals.set(DECIMALS); } }
[ "public", "void", "setTickLabelDecimals", "(", "final", "int", "DECIMALS", ")", "{", "if", "(", "null", "==", "tickLabelDecimals", ")", "{", "_tickLabelDecimals", "=", "clamp", "(", "0", ",", "MAX_NO_OF_DECIMALS", ",", "DECIMALS", ")", ";", "fireTileEvent", "(", "REDRAW_EVENT", ")", ";", "}", "else", "{", "tickLabelDecimals", ".", "set", "(", "DECIMALS", ")", ";", "}", "}" ]
Defines the number of tickLabelDecimals that will be used to format the ticklabels of the gauge. The number of tickLabelDecimals will be clamped to a value between 0-3. @param DECIMALS
[ "Defines", "the", "number", "of", "tickLabelDecimals", "that", "will", "be", "used", "to", "format", "the", "ticklabels", "of", "the", "gauge", ".", "The", "number", "of", "tickLabelDecimals", "will", "be", "clamped", "to", "a", "value", "between", "0", "-", "3", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L2863-L2870
20,931
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setDescriptionColor
public void setDescriptionColor(final Color COLOR) { if (null == descriptionColor) { _descriptionColor = COLOR; fireTileEvent(REDRAW_EVENT); } else { descriptionColor.set(COLOR); } }
java
public void setDescriptionColor(final Color COLOR) { if (null == descriptionColor) { _descriptionColor = COLOR; fireTileEvent(REDRAW_EVENT); } else { descriptionColor.set(COLOR); } }
[ "public", "void", "setDescriptionColor", "(", "final", "Color", "COLOR", ")", "{", "if", "(", "null", "==", "descriptionColor", ")", "{", "_descriptionColor", "=", "COLOR", ";", "fireTileEvent", "(", "REDRAW_EVENT", ")", ";", "}", "else", "{", "descriptionColor", ".", "set", "(", "COLOR", ")", ";", "}", "}" ]
Defines the color that will be used to colorize the description text of the gauge. @param COLOR
[ "Defines", "the", "color", "that", "will", "be", "used", "to", "colorize", "the", "description", "text", "of", "the", "gauge", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L3031-L3038
20,932
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setUnitColor
public void setUnitColor(final Color COLOR) { if (null == unitColor) { _unitColor = COLOR; fireTileEvent(REDRAW_EVENT); } else { unitColor.set(COLOR); } }
java
public void setUnitColor(final Color COLOR) { if (null == unitColor) { _unitColor = COLOR; fireTileEvent(REDRAW_EVENT); } else { unitColor.set(COLOR); } }
[ "public", "void", "setUnitColor", "(", "final", "Color", "COLOR", ")", "{", "if", "(", "null", "==", "unitColor", ")", "{", "_unitColor", "=", "COLOR", ";", "fireTileEvent", "(", "REDRAW_EVENT", ")", ";", "}", "else", "{", "unitColor", ".", "set", "(", "COLOR", ")", ";", "}", "}" ]
Defines the color that will be used to colorize the unit of the gauge. @param COLOR
[ "Defines", "the", "color", "that", "will", "be", "used", "to", "colorize", "the", "unit", "of", "the", "gauge", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L3064-L3071
20,933
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setValueColor
public void setValueColor(final Color COLOR) { if (null == valueColor) { _valueColor = COLOR; fireTileEvent(REDRAW_EVENT); } else { valueColor.set(COLOR); } }
java
public void setValueColor(final Color COLOR) { if (null == valueColor) { _valueColor = COLOR; fireTileEvent(REDRAW_EVENT); } else { valueColor.set(COLOR); } }
[ "public", "void", "setValueColor", "(", "final", "Color", "COLOR", ")", "{", "if", "(", "null", "==", "valueColor", ")", "{", "_valueColor", "=", "COLOR", ";", "fireTileEvent", "(", "REDRAW_EVENT", ")", ";", "}", "else", "{", "valueColor", ".", "set", "(", "COLOR", ")", ";", "}", "}" ]
Defines the color that will be used to colorize the value of the gauge. @param COLOR
[ "Defines", "the", "color", "that", "will", "be", "used", "to", "colorize", "the", "value", "of", "the", "gauge", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L3097-L3104
20,934
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setThresholdColor
public void setThresholdColor(final Color COLOR) { if (null == thresholdColor) { _thresholdColor = COLOR; fireTileEvent(REDRAW_EVENT); } else { thresholdColor.set(COLOR); } }
java
public void setThresholdColor(final Color COLOR) { if (null == thresholdColor) { _thresholdColor = COLOR; fireTileEvent(REDRAW_EVENT); } else { thresholdColor.set(COLOR); } }
[ "public", "void", "setThresholdColor", "(", "final", "Color", "COLOR", ")", "{", "if", "(", "null", "==", "thresholdColor", ")", "{", "_thresholdColor", "=", "COLOR", ";", "fireTileEvent", "(", "REDRAW_EVENT", ")", ";", "}", "else", "{", "thresholdColor", ".", "set", "(", "COLOR", ")", ";", "}", "}" ]
Defines the color that will be used to colorize the threshold indicator of the gauge. @param COLOR
[ "Defines", "the", "color", "that", "will", "be", "used", "to", "colorize", "the", "threshold", "indicator", "of", "the", "gauge", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L3130-L3137
20,935
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setSectionsVisible
public void setSectionsVisible(final boolean VISIBLE) { if (null == sectionsVisible) { _sectionsVisible = VISIBLE; fireTileEvent(REDRAW_EVENT); } else { sectionsVisible.set(VISIBLE); } }
java
public void setSectionsVisible(final boolean VISIBLE) { if (null == sectionsVisible) { _sectionsVisible = VISIBLE; fireTileEvent(REDRAW_EVENT); } else { sectionsVisible.set(VISIBLE); } }
[ "public", "void", "setSectionsVisible", "(", "final", "boolean", "VISIBLE", ")", "{", "if", "(", "null", "==", "sectionsVisible", ")", "{", "_sectionsVisible", "=", "VISIBLE", ";", "fireTileEvent", "(", "REDRAW_EVENT", ")", ";", "}", "else", "{", "sectionsVisible", ".", "set", "(", "VISIBLE", ")", ";", "}", "}" ]
Defines if the sections will be drawn @param VISIBLE
[ "Defines", "if", "the", "sections", "will", "be", "drawn" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L3307-L3314
20,936
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setHighlightSections
public void setHighlightSections(final boolean HIGHLIGHT) { if (null == highlightSections) { _highlightSections = HIGHLIGHT; fireTileEvent(REDRAW_EVENT); } else { highlightSections.set(HIGHLIGHT); } }
java
public void setHighlightSections(final boolean HIGHLIGHT) { if (null == highlightSections) { _highlightSections = HIGHLIGHT; fireTileEvent(REDRAW_EVENT); } else { highlightSections.set(HIGHLIGHT); } }
[ "public", "void", "setHighlightSections", "(", "final", "boolean", "HIGHLIGHT", ")", "{", "if", "(", "null", "==", "highlightSections", ")", "{", "_highlightSections", "=", "HIGHLIGHT", ";", "fireTileEvent", "(", "REDRAW_EVENT", ")", ";", "}", "else", "{", "highlightSections", ".", "set", "(", "HIGHLIGHT", ")", ";", "}", "}" ]
Defines if sections should be highlighted in case they contain the current value @param HIGHLIGHT
[ "Defines", "if", "sections", "should", "be", "highlighted", "in", "case", "they", "contain", "the", "current", "value" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L3433-L3440
20,937
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.getTime
public ZonedDateTime getTime() { if (null == time) { ZonedDateTime now = ZonedDateTime.now(); time = new ObjectPropertyBase<ZonedDateTime>(now) { @Override protected void invalidated() { zoneId = get().getZone(); fireTileEvent(RECALC_EVENT); if (!isRunning() && isAnimated()) { long animationDuration = getAnimationDuration(); timeline.stop(); final KeyValue KEY_VALUE = new KeyValue(currentTime, now.toEpochSecond()); final KeyFrame KEY_FRAME = new KeyFrame(javafx.util.Duration.millis(animationDuration), KEY_VALUE); timeline.getKeyFrames().setAll(KEY_FRAME); timeline.setOnFinished(e -> fireTileEvent(FINISHED_EVENT)); timeline.play(); } else { currentTime.set(now.toEpochSecond()); fireTileEvent(FINISHED_EVENT); } } @Override public Object getBean() { return Tile.this; } @Override public String getName() { return "time"; } }; } return time.get(); }
java
public ZonedDateTime getTime() { if (null == time) { ZonedDateTime now = ZonedDateTime.now(); time = new ObjectPropertyBase<ZonedDateTime>(now) { @Override protected void invalidated() { zoneId = get().getZone(); fireTileEvent(RECALC_EVENT); if (!isRunning() && isAnimated()) { long animationDuration = getAnimationDuration(); timeline.stop(); final KeyValue KEY_VALUE = new KeyValue(currentTime, now.toEpochSecond()); final KeyFrame KEY_FRAME = new KeyFrame(javafx.util.Duration.millis(animationDuration), KEY_VALUE); timeline.getKeyFrames().setAll(KEY_FRAME); timeline.setOnFinished(e -> fireTileEvent(FINISHED_EVENT)); timeline.play(); } else { currentTime.set(now.toEpochSecond()); fireTileEvent(FINISHED_EVENT); } } @Override public Object getBean() { return Tile.this; } @Override public String getName() { return "time"; } }; } return time.get(); }
[ "public", "ZonedDateTime", "getTime", "(", ")", "{", "if", "(", "null", "==", "time", ")", "{", "ZonedDateTime", "now", "=", "ZonedDateTime", ".", "now", "(", ")", ";", "time", "=", "new", "ObjectPropertyBase", "<", "ZonedDateTime", ">", "(", "now", ")", "{", "@", "Override", "protected", "void", "invalidated", "(", ")", "{", "zoneId", "=", "get", "(", ")", ".", "getZone", "(", ")", ";", "fireTileEvent", "(", "RECALC_EVENT", ")", ";", "if", "(", "!", "isRunning", "(", ")", "&&", "isAnimated", "(", ")", ")", "{", "long", "animationDuration", "=", "getAnimationDuration", "(", ")", ";", "timeline", ".", "stop", "(", ")", ";", "final", "KeyValue", "KEY_VALUE", "=", "new", "KeyValue", "(", "currentTime", ",", "now", ".", "toEpochSecond", "(", ")", ")", ";", "final", "KeyFrame", "KEY_FRAME", "=", "new", "KeyFrame", "(", "javafx", ".", "util", ".", "Duration", ".", "millis", "(", "animationDuration", ")", ",", "KEY_VALUE", ")", ";", "timeline", ".", "getKeyFrames", "(", ")", ".", "setAll", "(", "KEY_FRAME", ")", ";", "timeline", ".", "setOnFinished", "(", "e", "->", "fireTileEvent", "(", "FINISHED_EVENT", ")", ")", ";", "timeline", ".", "play", "(", ")", ";", "}", "else", "{", "currentTime", ".", "set", "(", "now", ".", "toEpochSecond", "(", ")", ")", ";", "fireTileEvent", "(", "FINISHED_EVENT", ")", ";", "}", "}", "@", "Override", "public", "Object", "getBean", "(", ")", "{", "return", "Tile", ".", "this", ";", "}", "@", "Override", "public", "String", "getName", "(", ")", "{", "return", "\"time\"", ";", "}", "}", ";", "}", "return", "time", ".", "get", "(", ")", ";", "}" ]
Returns the current time of the clock. @return the current time of the clock
[ "Returns", "the", "current", "time", "of", "the", "clock", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L3628-L3653
20,938
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setTextAlignment
public void setTextAlignment(final TextAlignment ALIGNMENT) { if (null == textAlignment) { _textAlignment = ALIGNMENT; fireTileEvent(RESIZE_EVENT); } else { textAlignment.set(ALIGNMENT); } }
java
public void setTextAlignment(final TextAlignment ALIGNMENT) { if (null == textAlignment) { _textAlignment = ALIGNMENT; fireTileEvent(RESIZE_EVENT); } else { textAlignment.set(ALIGNMENT); } }
[ "public", "void", "setTextAlignment", "(", "final", "TextAlignment", "ALIGNMENT", ")", "{", "if", "(", "null", "==", "textAlignment", ")", "{", "_textAlignment", "=", "ALIGNMENT", ";", "fireTileEvent", "(", "RESIZE_EVENT", ")", ";", "}", "else", "{", "textAlignment", ".", "set", "(", "ALIGNMENT", ")", ";", "}", "}" ]
Defines the alignment that will be used to align the text in the Tile. Keep in mind that this property will not be used by every skin. @param ALIGNMENT
[ "Defines", "the", "alignment", "that", "will", "be", "used", "to", "align", "the", "text", "in", "the", "Tile", ".", "Keep", "in", "mind", "that", "this", "property", "will", "not", "be", "used", "by", "every", "skin", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L3723-L3730
20,939
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setDiscreteSeconds
public void setDiscreteSeconds(boolean DISCRETE) { if (null == discreteSeconds) { _discreteSeconds = DISCRETE; stopTask(periodicTickTask); if (isAnimated()) return; scheduleTickTask(); } else { discreteSeconds.set(DISCRETE); } }
java
public void setDiscreteSeconds(boolean DISCRETE) { if (null == discreteSeconds) { _discreteSeconds = DISCRETE; stopTask(periodicTickTask); if (isAnimated()) return; scheduleTickTask(); } else { discreteSeconds.set(DISCRETE); } }
[ "public", "void", "setDiscreteSeconds", "(", "boolean", "DISCRETE", ")", "{", "if", "(", "null", "==", "discreteSeconds", ")", "{", "_discreteSeconds", "=", "DISCRETE", ";", "stopTask", "(", "periodicTickTask", ")", ";", "if", "(", "isAnimated", "(", ")", ")", "return", ";", "scheduleTickTask", "(", ")", ";", "}", "else", "{", "discreteSeconds", ".", "set", "(", "DISCRETE", ")", ";", "}", "}" ]
Defines if the second hand of the clock should move in discrete steps of 1 second. Otherwise it will move continuously like in an automatic clock. @param DISCRETE
[ "Defines", "if", "the", "second", "hand", "of", "the", "clock", "should", "move", "in", "discrete", "steps", "of", "1", "second", ".", "Otherwise", "it", "will", "move", "continuously", "like", "in", "an", "automatic", "clock", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L3819-L3828
20,940
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setDiscreteMinutes
public void setDiscreteMinutes(boolean DISCRETE) { if (null == discreteMinutes) { _discreteMinutes = DISCRETE; stopTask(periodicTickTask); if (isAnimated()) return; scheduleTickTask(); } else { discreteMinutes.set(DISCRETE); } }
java
public void setDiscreteMinutes(boolean DISCRETE) { if (null == discreteMinutes) { _discreteMinutes = DISCRETE; stopTask(periodicTickTask); if (isAnimated()) return; scheduleTickTask(); } else { discreteMinutes.set(DISCRETE); } }
[ "public", "void", "setDiscreteMinutes", "(", "boolean", "DISCRETE", ")", "{", "if", "(", "null", "==", "discreteMinutes", ")", "{", "_discreteMinutes", "=", "DISCRETE", ";", "stopTask", "(", "periodicTickTask", ")", ";", "if", "(", "isAnimated", "(", ")", ")", "return", ";", "scheduleTickTask", "(", ")", ";", "}", "else", "{", "discreteMinutes", ".", "set", "(", "DISCRETE", ")", ";", "}", "}" ]
Defines if the minute hand of the clock should move in discrete steps of 1 minute. Otherwise it will move continuously like in an automatic clock. @param DISCRETE
[ "Defines", "if", "the", "minute", "hand", "of", "the", "clock", "should", "move", "in", "discrete", "steps", "of", "1", "minute", ".", "Otherwise", "it", "will", "move", "continuously", "like", "in", "an", "automatic", "clock", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L3857-L3866
20,941
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setRunning
public void setRunning(boolean RUNNING) { if (null == running) { _running = RUNNING; if (RUNNING && !isAnimated()) { scheduleTickTask(); } else { stopTask(periodicTickTask); } } else { running.set(RUNNING); } }
java
public void setRunning(boolean RUNNING) { if (null == running) { _running = RUNNING; if (RUNNING && !isAnimated()) { scheduleTickTask(); } else { stopTask(periodicTickTask); } } else { running.set(RUNNING); } }
[ "public", "void", "setRunning", "(", "boolean", "RUNNING", ")", "{", "if", "(", "null", "==", "running", ")", "{", "_running", "=", "RUNNING", ";", "if", "(", "RUNNING", "&&", "!", "isAnimated", "(", ")", ")", "{", "scheduleTickTask", "(", ")", ";", "}", "else", "{", "stopTask", "(", "periodicTickTask", ")", ";", "}", "}", "else", "{", "running", ".", "set", "(", "RUNNING", ")", ";", "}", "}" ]
Defines if the clock is running. The clock will only start running if animated == false; @param RUNNING
[ "Defines", "if", "the", "clock", "is", "running", ".", "The", "clock", "will", "only", "start", "running", "if", "animated", "==", "false", ";" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L4005-L4012
20,942
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setHourTickMarkColor
public void setHourTickMarkColor(final Color COLOR) { if (null == hourTickMarkColor) { _hourTickMarkColor = COLOR; fireTileEvent(REDRAW_EVENT); } else { hourTickMarkColor.set(COLOR); } }
java
public void setHourTickMarkColor(final Color COLOR) { if (null == hourTickMarkColor) { _hourTickMarkColor = COLOR; fireTileEvent(REDRAW_EVENT); } else { hourTickMarkColor.set(COLOR); } }
[ "public", "void", "setHourTickMarkColor", "(", "final", "Color", "COLOR", ")", "{", "if", "(", "null", "==", "hourTickMarkColor", ")", "{", "_hourTickMarkColor", "=", "COLOR", ";", "fireTileEvent", "(", "REDRAW_EVENT", ")", ";", "}", "else", "{", "hourTickMarkColor", ".", "set", "(", "COLOR", ")", ";", "}", "}" ]
Defines the color that will be used to colorize the hour tickmarks of the clock. @param COLOR
[ "Defines", "the", "color", "that", "will", "be", "used", "to", "colorize", "the", "hour", "tickmarks", "of", "the", "clock", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L4092-L4099
20,943
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setAlarmColor
public void setAlarmColor(final Color COLOR) { if (null == alarmColor) { _alarmColor = COLOR; fireTileEvent(REDRAW_EVENT); } else { alarmColor.set(COLOR); } }
java
public void setAlarmColor(final Color COLOR) { if (null == alarmColor) { _alarmColor = COLOR; fireTileEvent(REDRAW_EVENT); } else { alarmColor.set(COLOR); } }
[ "public", "void", "setAlarmColor", "(", "final", "Color", "COLOR", ")", "{", "if", "(", "null", "==", "alarmColor", ")", "{", "_alarmColor", "=", "COLOR", ";", "fireTileEvent", "(", "REDRAW_EVENT", ")", ";", "}", "else", "{", "alarmColor", ".", "set", "(", "COLOR", ")", ";", "}", "}" ]
Defines the color that will be used to colorize the alarm icon @param COLOR
[ "Defines", "the", "color", "that", "will", "be", "used", "to", "colorize", "the", "alarm", "icon" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L4150-L4157
20,944
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setHourColor
public void setHourColor(final Color COLOR) { if (null == hourColor) { _hourColor = COLOR; fireTileEvent(REDRAW_EVENT); } else { hourColor.set(COLOR); } }
java
public void setHourColor(final Color COLOR) { if (null == hourColor) { _hourColor = COLOR; fireTileEvent(REDRAW_EVENT); } else { hourColor.set(COLOR); } }
[ "public", "void", "setHourColor", "(", "final", "Color", "COLOR", ")", "{", "if", "(", "null", "==", "hourColor", ")", "{", "_hourColor", "=", "COLOR", ";", "fireTileEvent", "(", "REDRAW_EVENT", ")", ";", "}", "else", "{", "hourColor", ".", "set", "(", "COLOR", ")", ";", "}", "}" ]
Defines the color that will be used to colorize the hour hand of the clock @param COLOR
[ "Defines", "the", "color", "that", "will", "be", "used", "to", "colorize", "the", "hour", "hand", "of", "the", "clock" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L4235-L4242
20,945
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setMinuteColor
public void setMinuteColor(final Color COLOR) { if (null == minuteColor) { _minuteColor = COLOR; fireTileEvent(REDRAW_EVENT); } else { minuteColor.set(COLOR); } }
java
public void setMinuteColor(final Color COLOR) { if (null == minuteColor) { _minuteColor = COLOR; fireTileEvent(REDRAW_EVENT); } else { minuteColor.set(COLOR); } }
[ "public", "void", "setMinuteColor", "(", "final", "Color", "COLOR", ")", "{", "if", "(", "null", "==", "minuteColor", ")", "{", "_minuteColor", "=", "COLOR", ";", "fireTileEvent", "(", "REDRAW_EVENT", ")", ";", "}", "else", "{", "minuteColor", ".", "set", "(", "COLOR", ")", ";", "}", "}" ]
Defines the color that will be used to colorize the minute hand of the clock. @param COLOR
[ "Defines", "the", "color", "that", "will", "be", "used", "to", "colorize", "the", "minute", "hand", "of", "the", "clock", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L4264-L4271
20,946
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setTooltipText
public void setTooltipText(final String TEXT) { if (null == tooltipText) { tooltip.setText(TEXT); if (null == TEXT || TEXT.isEmpty()) { setTooltip(null); } else { setTooltip(tooltip); } } else { tooltipText.set(TEXT); } }
java
public void setTooltipText(final String TEXT) { if (null == tooltipText) { tooltip.setText(TEXT); if (null == TEXT || TEXT.isEmpty()) { setTooltip(null); } else { setTooltip(tooltip); } } else { tooltipText.set(TEXT); } }
[ "public", "void", "setTooltipText", "(", "final", "String", "TEXT", ")", "{", "if", "(", "null", "==", "tooltipText", ")", "{", "tooltip", ".", "setText", "(", "TEXT", ")", ";", "if", "(", "null", "==", "TEXT", "||", "TEXT", ".", "isEmpty", "(", ")", ")", "{", "setTooltip", "(", "null", ")", ";", "}", "else", "{", "setTooltip", "(", "tooltip", ")", ";", "}", "}", "else", "{", "tooltipText", ".", "set", "(", "TEXT", ")", ";", "}", "}" ]
Defines the text that will be shown in the Tile tooltip @param TEXT
[ "Defines", "the", "text", "that", "will", "be", "shown", "in", "the", "Tile", "tooltip" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L4413-L4425
20,947
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setRadarChartMode
public void setRadarChartMode(final RadarChart.Mode MODE) { if (null == radarChartMode) { _radarChartMode = MODE; fireTileEvent(RECALC_EVENT); } else { radarChartMode.set(MODE); } }
java
public void setRadarChartMode(final RadarChart.Mode MODE) { if (null == radarChartMode) { _radarChartMode = MODE; fireTileEvent(RECALC_EVENT); } else { radarChartMode.set(MODE); } }
[ "public", "void", "setRadarChartMode", "(", "final", "RadarChart", ".", "Mode", "MODE", ")", "{", "if", "(", "null", "==", "radarChartMode", ")", "{", "_radarChartMode", "=", "MODE", ";", "fireTileEvent", "(", "RECALC_EVENT", ")", ";", "}", "else", "{", "radarChartMode", ".", "set", "(", "MODE", ")", ";", "}", "}" ]
Defines the mode that is used in the RadarChartTileSkin to visualize the data in the RadarChart. There are Mode.POLYGON and Mode.SECTOR. @param MODE
[ "Defines", "the", "mode", "that", "is", "used", "in", "the", "RadarChartTileSkin", "to", "visualize", "the", "data", "in", "the", "RadarChart", ".", "There", "are", "Mode", ".", "POLYGON", "and", "Mode", ".", "SECTOR", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L4501-L4508
20,948
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.getCountry
public Country getCountry() { if (null == _country && null == country) { _country = Country.DE; } return null == country ? _country : country.get(); }
java
public Country getCountry() { if (null == _country && null == country) { _country = Country.DE; } return null == country ? _country : country.get(); }
[ "public", "Country", "getCountry", "(", ")", "{", "if", "(", "null", "==", "_country", "&&", "null", "==", "country", ")", "{", "_country", "=", "Country", ".", "DE", ";", "}", "return", "null", "==", "country", "?", "_country", ":", "country", ".", "get", "(", ")", ";", "}" ]
Returns the Locale that will be used to visualize the country in the CountryTileSkin @return the Locale that will be used to visualize the country in the CountryTileSkin
[ "Returns", "the", "Locale", "that", "will", "be", "used", "to", "visualize", "the", "country", "in", "the", "CountryTileSkin" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L4557-L4560
20,949
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setCountry
public void setCountry(final Country COUNTRY) { if (null == country) { _country = COUNTRY; fireTileEvent(RECALC_EVENT); } else { country.set(COUNTRY); } }
java
public void setCountry(final Country COUNTRY) { if (null == country) { _country = COUNTRY; fireTileEvent(RECALC_EVENT); } else { country.set(COUNTRY); } }
[ "public", "void", "setCountry", "(", "final", "Country", "COUNTRY", ")", "{", "if", "(", "null", "==", "country", ")", "{", "_country", "=", "COUNTRY", ";", "fireTileEvent", "(", "RECALC_EVENT", ")", ";", "}", "else", "{", "country", ".", "set", "(", "COUNTRY", ")", ";", "}", "}" ]
Defines the Locale that will be used to visualize the country in the CountryTileSkin @param COUNTRY
[ "Defines", "the", "Locale", "that", "will", "be", "used", "to", "visualize", "the", "country", "in", "the", "CountryTileSkin" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L4566-L4573
20,950
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setStrokeWithGradient
public void setStrokeWithGradient(final boolean STROKE_WITH_GRADIENT) { if (null == strokeWithGradient) { _strokeWithGradient = STROKE_WITH_GRADIENT; fireTileEvent(REDRAW_EVENT); } else { strokeWithGradient.set(STROKE_WITH_GRADIENT); } }
java
public void setStrokeWithGradient(final boolean STROKE_WITH_GRADIENT) { if (null == strokeWithGradient) { _strokeWithGradient = STROKE_WITH_GRADIENT; fireTileEvent(REDRAW_EVENT); } else { strokeWithGradient.set(STROKE_WITH_GRADIENT); } }
[ "public", "void", "setStrokeWithGradient", "(", "final", "boolean", "STROKE_WITH_GRADIENT", ")", "{", "if", "(", "null", "==", "strokeWithGradient", ")", "{", "_strokeWithGradient", "=", "STROKE_WITH_GRADIENT", ";", "fireTileEvent", "(", "REDRAW_EVENT", ")", ";", "}", "else", "{", "strokeWithGradient", ".", "set", "(", "STROKE_WITH_GRADIENT", ")", ";", "}", "}" ]
Defines the usage of a gradient defined by gradientStops to stroke the line in the SparklineTileSkin @param STROKE_WITH_GRADIENT
[ "Defines", "the", "usage", "of", "a", "gradient", "defined", "by", "gradientStops", "to", "stroke", "the", "line", "in", "the", "SparklineTileSkin" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L4809-L4816
20,951
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setFillWithGradient
public void setFillWithGradient(final boolean FILL_WITH_GRADIENT) { if (null == fillWithGradient) { _fillWithGradient = FILL_WITH_GRADIENT; fireTileEvent(REDRAW_EVENT); } else { fillWithGradient.set(FILL_WITH_GRADIENT); } }
java
public void setFillWithGradient(final boolean FILL_WITH_GRADIENT) { if (null == fillWithGradient) { _fillWithGradient = FILL_WITH_GRADIENT; fireTileEvent(REDRAW_EVENT); } else { fillWithGradient.set(FILL_WITH_GRADIENT); } }
[ "public", "void", "setFillWithGradient", "(", "final", "boolean", "FILL_WITH_GRADIENT", ")", "{", "if", "(", "null", "==", "fillWithGradient", ")", "{", "_fillWithGradient", "=", "FILL_WITH_GRADIENT", ";", "fireTileEvent", "(", "REDRAW_EVENT", ")", ";", "}", "else", "{", "fillWithGradient", ".", "set", "(", "FILL_WITH_GRADIENT", ")", ";", "}", "}" ]
Defines the usage of a gradient defined by gradientStops to fill the area in the SmoothAreaTileSkin @param FILL_WITH_GRADIENT
[ "Defines", "the", "usage", "of", "a", "gradient", "defined", "by", "gradientStops", "to", "fill", "the", "area", "in", "the", "SmoothAreaTileSkin" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L4839-L4846
20,952
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Section.java
Section.setStart
public void setStart(final double START) { if (null == start) { _start = START; fireSectionEvent(UPDATE_EVENT); } else { start.set(START); } }
java
public void setStart(final double START) { if (null == start) { _start = START; fireSectionEvent(UPDATE_EVENT); } else { start.set(START); } }
[ "public", "void", "setStart", "(", "final", "double", "START", ")", "{", "if", "(", "null", "==", "start", ")", "{", "_start", "=", "START", ";", "fireSectionEvent", "(", "UPDATE_EVENT", ")", ";", "}", "else", "{", "start", ".", "set", "(", "START", ")", ";", "}", "}" ]
Defines the value where the section begins. @param START
[ "Defines", "the", "value", "where", "the", "section", "begins", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Section.java#L138-L145
20,953
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Section.java
Section.setStop
public void setStop(final double STOP) { if (null == stop) { _stop = STOP; fireSectionEvent(UPDATE_EVENT); } else { stop.set(STOP); } }
java
public void setStop(final double STOP) { if (null == stop) { _stop = STOP; fireSectionEvent(UPDATE_EVENT); } else { stop.set(STOP); } }
[ "public", "void", "setStop", "(", "final", "double", "STOP", ")", "{", "if", "(", "null", "==", "stop", ")", "{", "_stop", "=", "STOP", ";", "fireSectionEvent", "(", "UPDATE_EVENT", ")", ";", "}", "else", "{", "stop", ".", "set", "(", "STOP", ")", ";", "}", "}" ]
Defines the value where the section ends. @param STOP
[ "Defines", "the", "value", "where", "the", "section", "ends", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Section.java#L166-L173
20,954
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Section.java
Section.setText
public void setText(final String TEXT) { if (null == text) { _text = TEXT; fireSectionEvent(UPDATE_EVENT); } else { text.set(TEXT); } }
java
public void setText(final String TEXT) { if (null == text) { _text = TEXT; fireSectionEvent(UPDATE_EVENT); } else { text.set(TEXT); } }
[ "public", "void", "setText", "(", "final", "String", "TEXT", ")", "{", "if", "(", "null", "==", "text", ")", "{", "_text", "=", "TEXT", ";", "fireSectionEvent", "(", "UPDATE_EVENT", ")", ";", "}", "else", "{", "text", ".", "set", "(", "TEXT", ")", ";", "}", "}" ]
Defines a text for the section. @param TEXT
[ "Defines", "a", "text", "for", "the", "section", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Section.java#L194-L201
20,955
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Section.java
Section.setColor
public void setColor(final Color COLOR) { if (null == color) { _color = COLOR; fireSectionEvent(UPDATE_EVENT); } else { color.set(COLOR); } }
java
public void setColor(final Color COLOR) { if (null == color) { _color = COLOR; fireSectionEvent(UPDATE_EVENT); } else { color.set(COLOR); } }
[ "public", "void", "setColor", "(", "final", "Color", "COLOR", ")", "{", "if", "(", "null", "==", "color", ")", "{", "_color", "=", "COLOR", ";", "fireSectionEvent", "(", "UPDATE_EVENT", ")", ";", "}", "else", "{", "color", ".", "set", "(", "COLOR", ")", ";", "}", "}" ]
Defines the color that will be used to colorize the section in a gauge. @param COLOR
[ "Defines", "the", "color", "that", "will", "be", "used", "to", "colorize", "the", "section", "in", "a", "gauge", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Section.java#L254-L261
20,956
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Section.java
Section.setTextColor
public void setTextColor(final Color COLOR) { if (null == textColor) { _textColor = COLOR; fireSectionEvent(UPDATE_EVENT); } else { textColor.set(COLOR); } }
java
public void setTextColor(final Color COLOR) { if (null == textColor) { _textColor = COLOR; fireSectionEvent(UPDATE_EVENT); } else { textColor.set(COLOR); } }
[ "public", "void", "setTextColor", "(", "final", "Color", "COLOR", ")", "{", "if", "(", "null", "==", "textColor", ")", "{", "_textColor", "=", "COLOR", ";", "fireSectionEvent", "(", "UPDATE_EVENT", ")", ";", "}", "else", "{", "textColor", ".", "set", "(", "COLOR", ")", ";", "}", "}" ]
Defines the color that will be used to colorize the section text. @param COLOR
[ "Defines", "the", "color", "that", "will", "be", "used", "to", "colorize", "the", "section", "text", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Section.java#L311-L318
20,957
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/chart/SmoothedChart.java
SmoothedChart.getPaths
private Path[] getPaths(final Series<X, Y> SERIES) { if (!getData().contains(SERIES)) { return null; } Node seriesNode = SERIES.getNode(); if (null == seriesNode) { return null; } Group seriesGroup = (Group) seriesNode; if (seriesGroup.getChildren().isEmpty() || seriesGroup.getChildren().size() < 2) { return null; } return new Path[] { /* FillPath */ (Path) (seriesGroup).getChildren().get(0), /* StrokePath */ (Path) (seriesGroup).getChildren().get(1) }; }
java
private Path[] getPaths(final Series<X, Y> SERIES) { if (!getData().contains(SERIES)) { return null; } Node seriesNode = SERIES.getNode(); if (null == seriesNode) { return null; } Group seriesGroup = (Group) seriesNode; if (seriesGroup.getChildren().isEmpty() || seriesGroup.getChildren().size() < 2) { return null; } return new Path[] { /* FillPath */ (Path) (seriesGroup).getChildren().get(0), /* StrokePath */ (Path) (seriesGroup).getChildren().get(1) }; }
[ "private", "Path", "[", "]", "getPaths", "(", "final", "Series", "<", "X", ",", "Y", ">", "SERIES", ")", "{", "if", "(", "!", "getData", "(", ")", ".", "contains", "(", "SERIES", ")", ")", "{", "return", "null", ";", "}", "Node", "seriesNode", "=", "SERIES", ".", "getNode", "(", ")", ";", "if", "(", "null", "==", "seriesNode", ")", "{", "return", "null", ";", "}", "Group", "seriesGroup", "=", "(", "Group", ")", "seriesNode", ";", "if", "(", "seriesGroup", ".", "getChildren", "(", ")", ".", "isEmpty", "(", ")", "||", "seriesGroup", ".", "getChildren", "(", ")", ".", "size", "(", ")", "<", "2", ")", "{", "return", "null", ";", "}", "return", "new", "Path", "[", "]", "{", "/* FillPath */", "(", "Path", ")", "(", "seriesGroup", ")", ".", "getChildren", "(", ")", ".", "get", "(", "0", ")", ",", "/* StrokePath */", "(", "Path", ")", "(", "seriesGroup", ")", ".", "getChildren", "(", ")", ".", "get", "(", "1", ")", "}", ";", "}" ]
Returns an array of paths where the first entry represents the fill path and the second entry represents the stroke path @param SERIES @return an array of paths where [0] == FillPath and [1] == StrokePath
[ "Returns", "an", "array", "of", "paths", "where", "the", "first", "entry", "represents", "the", "fill", "path", "and", "the", "second", "entry", "represents", "the", "stroke", "path" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/chart/SmoothedChart.java#L700-L711
20,958
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/TimeSection.java
TimeSection.setStart
public void setStart(final LocalTime START) { if (null == start) { _start = START; } else { start.set(START); } }
java
public void setStart(final LocalTime START) { if (null == start) { _start = START; } else { start.set(START); } }
[ "public", "void", "setStart", "(", "final", "LocalTime", "START", ")", "{", "if", "(", "null", "==", "start", ")", "{", "_start", "=", "START", ";", "}", "else", "{", "start", ".", "set", "(", "START", ")", ";", "}", "}" ]
Defines the time when the section starts. @param START
[ "Defines", "the", "time", "when", "the", "section", "starts", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/TimeSection.java#L146-L152
20,959
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/TimeSection.java
TimeSection.setStop
public void setStop(final LocalTime STOP) { if (null == stop) { _stop = STOP; } else { stop.set(STOP); } }
java
public void setStop(final LocalTime STOP) { if (null == stop) { _stop = STOP; } else { stop.set(STOP); } }
[ "public", "void", "setStop", "(", "final", "LocalTime", "STOP", ")", "{", "if", "(", "null", "==", "stop", ")", "{", "_stop", "=", "STOP", ";", "}", "else", "{", "stop", ".", "set", "(", "STOP", ")", ";", "}", "}" ]
Defines the time when the section ends @param STOP
[ "Defines", "the", "time", "when", "the", "section", "ends" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/TimeSection.java#L167-L173
20,960
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/TimeSection.java
TimeSection.setText
public void setText(final String TEXT) { if (null == text) { _text = TEXT; } else { text.set(TEXT); } }
java
public void setText(final String TEXT) { if (null == text) { _text = TEXT; } else { text.set(TEXT); } }
[ "public", "void", "setText", "(", "final", "String", "TEXT", ")", "{", "if", "(", "null", "==", "text", ")", "{", "_text", "=", "TEXT", ";", "}", "else", "{", "text", ".", "set", "(", "TEXT", ")", ";", "}", "}" ]
Defines the text for the section @param TEXT
[ "Defines", "the", "text", "for", "the", "section" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/TimeSection.java#L188-L194
20,961
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/TimeSection.java
TimeSection.setIcon
public void setIcon(final Image IMAGE) { if (null == icon) { _icon = IMAGE; } else { icon.set(IMAGE); } }
java
public void setIcon(final Image IMAGE) { if (null == icon) { _icon = IMAGE; } else { icon.set(IMAGE); } }
[ "public", "void", "setIcon", "(", "final", "Image", "IMAGE", ")", "{", "if", "(", "null", "==", "icon", ")", "{", "_icon", "=", "IMAGE", ";", "}", "else", "{", "icon", ".", "set", "(", "IMAGE", ")", ";", "}", "}" ]
Defines an image for the section. @param IMAGE
[ "Defines", "an", "image", "for", "the", "section", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/TimeSection.java#L209-L215
20,962
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/TimeSection.java
TimeSection.setColor
public void setColor(final Color COLOR) { if (null == color) { _color = COLOR; } else { color.set(COLOR); } }
java
public void setColor(final Color COLOR) { if (null == color) { _color = COLOR; } else { color.set(COLOR); } }
[ "public", "void", "setColor", "(", "final", "Color", "COLOR", ")", "{", "if", "(", "null", "==", "color", ")", "{", "_color", "=", "COLOR", ";", "}", "else", "{", "color", ".", "set", "(", "COLOR", ")", ";", "}", "}" ]
Defines the color that will be used to colorize the section in a clock. @param COLOR
[ "Defines", "the", "color", "that", "will", "be", "used", "to", "colorize", "the", "section", "in", "a", "clock", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/TimeSection.java#L232-L238
20,963
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/chart/SunburstChart.java
SunburstChart.setVisibleData
public void setVisibleData(final VisibleData VISIBLE_DATA) { if (null == visibleData) { _visibleData = VISIBLE_DATA; redraw(); } else { visibleData.set(VISIBLE_DATA); } }
java
public void setVisibleData(final VisibleData VISIBLE_DATA) { if (null == visibleData) { _visibleData = VISIBLE_DATA; redraw(); } else { visibleData.set(VISIBLE_DATA); } }
[ "public", "void", "setVisibleData", "(", "final", "VisibleData", "VISIBLE_DATA", ")", "{", "if", "(", "null", "==", "visibleData", ")", "{", "_visibleData", "=", "VISIBLE_DATA", ";", "redraw", "(", ")", ";", "}", "else", "{", "visibleData", ".", "set", "(", "VISIBLE_DATA", ")", ";", "}", "}" ]
Defines the data that should be visualized in the chart segments @param VISIBLE_DATA
[ "Defines", "the", "data", "that", "should", "be", "visualized", "in", "the", "chart", "segments" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/chart/SunburstChart.java#L245-L252
20,964
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/chart/SunburstChart.java
SunburstChart.setTextOrientation
public void setTextOrientation(final TextOrientation ORIENTATION) { if (null == textOrientation) { _textOrientation = ORIENTATION; redraw(); } else { textOrientation.set(ORIENTATION); } }
java
public void setTextOrientation(final TextOrientation ORIENTATION) { if (null == textOrientation) { _textOrientation = ORIENTATION; redraw(); } else { textOrientation.set(ORIENTATION); } }
[ "public", "void", "setTextOrientation", "(", "final", "TextOrientation", "ORIENTATION", ")", "{", "if", "(", "null", "==", "textOrientation", ")", "{", "_textOrientation", "=", "ORIENTATION", ";", "redraw", "(", ")", ";", "}", "else", "{", "textOrientation", ".", "set", "(", "ORIENTATION", ")", ";", "}", "}" ]
Defines the orientation the text will be drawn in the segments @param ORIENTATION
[ "Defines", "the", "orientation", "the", "text", "will", "be", "drawn", "in", "the", "segments" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/chart/SunburstChart.java#L274-L281
20,965
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/chart/SunburstChart.java
SunburstChart.setTextColor
public void setTextColor(final Color COLOR) { if (null == textColor) { _textColor = COLOR; redraw(); } else { textColor.set(COLOR); } }
java
public void setTextColor(final Color COLOR) { if (null == textColor) { _textColor = COLOR; redraw(); } else { textColor.set(COLOR); } }
[ "public", "void", "setTextColor", "(", "final", "Color", "COLOR", ")", "{", "if", "(", "null", "==", "textColor", ")", "{", "_textColor", "=", "COLOR", ";", "redraw", "(", ")", ";", "}", "else", "{", "textColor", ".", "set", "(", "COLOR", ")", ";", "}", "}" ]
Defines the color that will be used to draw text in segments if useChartDataTextColor == false @param COLOR
[ "Defines", "the", "color", "that", "will", "be", "used", "to", "draw", "text", "in", "segments", "if", "useChartDataTextColor", "==", "false" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/chart/SunburstChart.java#L332-L339
20,966
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/chart/SunburstChart.java
SunburstChart.setUseColorFromParent
public void setUseColorFromParent(final boolean USE) { if (null == useColorFromParent) { _useColorFromParent = USE; redraw(); } else { useColorFromParent.set(USE); } }
java
public void setUseColorFromParent(final boolean USE) { if (null == useColorFromParent) { _useColorFromParent = USE; redraw(); } else { useColorFromParent.set(USE); } }
[ "public", "void", "setUseColorFromParent", "(", "final", "boolean", "USE", ")", "{", "if", "(", "null", "==", "useColorFromParent", ")", "{", "_useColorFromParent", "=", "USE", ";", "redraw", "(", ")", ";", "}", "else", "{", "useColorFromParent", ".", "set", "(", "USE", ")", ";", "}", "}" ]
Defines if tthe color of all chart segments in one group should be filled with the color of the groups root node or by the color defined in the chart data elements @param USE
[ "Defines", "if", "tthe", "color", "of", "all", "chart", "segments", "in", "one", "group", "should", "be", "filled", "with", "the", "color", "of", "the", "groups", "root", "node", "or", "by", "the", "color", "defined", "in", "the", "chart", "data", "elements" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/chart/SunburstChart.java#L363-L370
20,967
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/chart/SunburstChart.java
SunburstChart.setDecimals
public void setDecimals(final int DECIMALS) { if (null == decimals) { _decimals = clamp(0, 5, DECIMALS); formatString = new StringBuilder("%.").append(_decimals).append("f").toString(); redraw(); } else { decimals.set(DECIMALS); } }
java
public void setDecimals(final int DECIMALS) { if (null == decimals) { _decimals = clamp(0, 5, DECIMALS); formatString = new StringBuilder("%.").append(_decimals).append("f").toString(); redraw(); } else { decimals.set(DECIMALS); } }
[ "public", "void", "setDecimals", "(", "final", "int", "DECIMALS", ")", "{", "if", "(", "null", "==", "decimals", ")", "{", "_decimals", "=", "clamp", "(", "0", ",", "5", ",", "DECIMALS", ")", ";", "formatString", "=", "new", "StringBuilder", "(", "\"%.\"", ")", ".", "append", "(", "_decimals", ")", ".", "append", "(", "\"f\"", ")", ".", "toString", "(", ")", ";", "redraw", "(", ")", ";", "}", "else", "{", "decimals", ".", "set", "(", "DECIMALS", ")", ";", "}", "}" ]
Defines the number of decimals that will be used to format the values in the tooltip @param DECIMALS
[ "Defines", "the", "number", "of", "decimals", "that", "will", "be", "used", "to", "format", "the", "values", "in", "the", "tooltip" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/chart/SunburstChart.java#L391-L399
20,968
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/chart/SunburstChart.java
SunburstChart.setInteractive
public void setInteractive(final boolean INTERACTIVE) { if (null == interactive) { _interactive = INTERACTIVE; redraw(); } else { interactive.set(INTERACTIVE); } }
java
public void setInteractive(final boolean INTERACTIVE) { if (null == interactive) { _interactive = INTERACTIVE; redraw(); } else { interactive.set(INTERACTIVE); } }
[ "public", "void", "setInteractive", "(", "final", "boolean", "INTERACTIVE", ")", "{", "if", "(", "null", "==", "interactive", ")", "{", "_interactive", "=", "INTERACTIVE", ";", "redraw", "(", ")", ";", "}", "else", "{", "interactive", ".", "set", "(", "INTERACTIVE", ")", ";", "}", "}" ]
Defines if the chart should be drawn using Path elements, fire ChartDataEvents and shows tooltips on segments or if the the chart should be drawn using one Canvas node. @param INTERACTIVE
[ "Defines", "if", "the", "chart", "should", "be", "drawn", "using", "Path", "elements", "fire", "ChartDataEvents", "and", "shows", "tooltips", "on", "segments", "or", "if", "the", "the", "chart", "should", "be", "drawn", "using", "one", "Canvas", "node", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/chart/SunburstChart.java#L425-L432
20,969
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/chart/SunburstChart.java
SunburstChart.setAutoTextColor
public void setAutoTextColor(final boolean AUTOMATIC) { if (null == autoTextColor) { _autoTextColor = AUTOMATIC; adjustTextColors(); redraw(); } else { autoTextColor.set(AUTOMATIC); } }
java
public void setAutoTextColor(final boolean AUTOMATIC) { if (null == autoTextColor) { _autoTextColor = AUTOMATIC; adjustTextColors(); redraw(); } else { autoTextColor.set(AUTOMATIC); } }
[ "public", "void", "setAutoTextColor", "(", "final", "boolean", "AUTOMATIC", ")", "{", "if", "(", "null", "==", "autoTextColor", ")", "{", "_autoTextColor", "=", "AUTOMATIC", ";", "adjustTextColors", "(", ")", ";", "redraw", "(", ")", ";", "}", "else", "{", "autoTextColor", ".", "set", "(", "AUTOMATIC", ")", ";", "}", "}" ]
Defines if the text color of the chart data should be adjusted according to the chart data fill color @param AUTOMATIC
[ "Defines", "if", "the", "text", "color", "of", "the", "chart", "data", "should", "be", "adjusted", "according", "to", "the", "chart", "data", "fill", "color" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/chart/SunburstChart.java#L454-L462
20,970
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/chart/SunburstChart.java
SunburstChart.setBrightTextColor
public void setBrightTextColor(final Color COLOR) { if (null == brightTextColor) { _brightTextColor = COLOR; if (isAutoTextColor()) { adjustTextColors(); redraw(); } } else { brightTextColor.set(COLOR); } }
java
public void setBrightTextColor(final Color COLOR) { if (null == brightTextColor) { _brightTextColor = COLOR; if (isAutoTextColor()) { adjustTextColors(); redraw(); } } else { brightTextColor.set(COLOR); } }
[ "public", "void", "setBrightTextColor", "(", "final", "Color", "COLOR", ")", "{", "if", "(", "null", "==", "brightTextColor", ")", "{", "_brightTextColor", "=", "COLOR", ";", "if", "(", "isAutoTextColor", "(", ")", ")", "{", "adjustTextColors", "(", ")", ";", "redraw", "(", ")", ";", "}", "}", "else", "{", "brightTextColor", ".", "set", "(", "COLOR", ")", ";", "}", "}" ]
Defines the color that will be used by the autoTextColor feature as the bright text on dark segment fill colors @param COLOR
[ "Defines", "the", "color", "that", "will", "be", "used", "by", "the", "autoTextColor", "feature", "as", "the", "bright", "text", "on", "dark", "segment", "fill", "colors" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/chart/SunburstChart.java#L487-L497
20,971
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/chart/SunburstChart.java
SunburstChart.setDarkTextColor
public void setDarkTextColor(final Color COLOR) { if (null == darkTextColor) { _darkTextColor = COLOR; if (isAutoTextColor()) { adjustTextColors(); redraw(); } } else { darkTextColor.set(COLOR); } }
java
public void setDarkTextColor(final Color COLOR) { if (null == darkTextColor) { _darkTextColor = COLOR; if (isAutoTextColor()) { adjustTextColors(); redraw(); } } else { darkTextColor.set(COLOR); } }
[ "public", "void", "setDarkTextColor", "(", "final", "Color", "COLOR", ")", "{", "if", "(", "null", "==", "darkTextColor", ")", "{", "_darkTextColor", "=", "COLOR", ";", "if", "(", "isAutoTextColor", "(", ")", ")", "{", "adjustTextColors", "(", ")", ";", "redraw", "(", ")", ";", "}", "}", "else", "{", "darkTextColor", ".", "set", "(", "COLOR", ")", ";", "}", "}" ]
Defines the color that will be used by the autoTextColor feature as the dark text on bright segment fill colors @param COLOR
[ "Defines", "the", "color", "that", "will", "be", "used", "by", "the", "autoTextColor", "feature", "as", "the", "dark", "text", "on", "bright", "segment", "fill", "colors" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/chart/SunburstChart.java#L524-L534
20,972
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/chart/SunburstChart.java
SunburstChart.setUseChartDataTextColor
public void setUseChartDataTextColor(final boolean USE) { if (null == useChartDataTextColor) { _useChartDataTextColor = USE; redraw(); } else { useChartDataTextColor.set(USE); } }
java
public void setUseChartDataTextColor(final boolean USE) { if (null == useChartDataTextColor) { _useChartDataTextColor = USE; redraw(); } else { useChartDataTextColor.set(USE); } }
[ "public", "void", "setUseChartDataTextColor", "(", "final", "boolean", "USE", ")", "{", "if", "(", "null", "==", "useChartDataTextColor", ")", "{", "_useChartDataTextColor", "=", "USE", ";", "redraw", "(", ")", ";", "}", "else", "{", "useChartDataTextColor", ".", "set", "(", "USE", ")", ";", "}", "}" ]
Defines if the text color of the segments should be taken from the ChartData elements @param USE
[ "Defines", "if", "the", "text", "color", "of", "the", "segments", "should", "be", "taken", "from", "the", "ChartData", "elements" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/chart/SunburstChart.java#L562-L569
20,973
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/chart/SunburstChart.java
SunburstChart.setTree
public void setTree(final TreeNode<ChartData> TREE) { if (null != tree) { getTreeNode().flattened().forEach(node -> node.removeAllTreeNodeEventListeners()); } tree.set(TREE); getTreeNode().flattened().forEach(node -> node.setOnTreeNodeEvent(e -> redraw())); prepareData(); if (isAutoTextColor()) { adjustTextColors(); } drawChart(); }
java
public void setTree(final TreeNode<ChartData> TREE) { if (null != tree) { getTreeNode().flattened().forEach(node -> node.removeAllTreeNodeEventListeners()); } tree.set(TREE); getTreeNode().flattened().forEach(node -> node.setOnTreeNodeEvent(e -> redraw())); prepareData(); if (isAutoTextColor()) { adjustTextColors(); } drawChart(); }
[ "public", "void", "setTree", "(", "final", "TreeNode", "<", "ChartData", ">", "TREE", ")", "{", "if", "(", "null", "!=", "tree", ")", "{", "getTreeNode", "(", ")", ".", "flattened", "(", ")", ".", "forEach", "(", "node", "->", "node", ".", "removeAllTreeNodeEventListeners", "(", ")", ")", ";", "}", "tree", ".", "set", "(", "TREE", ")", ";", "getTreeNode", "(", ")", ".", "flattened", "(", ")", ".", "forEach", "(", "node", "->", "node", ".", "setOnTreeNodeEvent", "(", "e", "->", "redraw", "(", ")", ")", ")", ";", "prepareData", "(", ")", ";", "if", "(", "isAutoTextColor", "(", ")", ")", "{", "adjustTextColors", "(", ")", ";", "}", "drawChart", "(", ")", ";", "}" ]
Defines the root element of the tree @param TREE
[ "Defines", "the", "root", "element", "of", "the", "tree" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/chart/SunburstChart.java#L588-L595
20,974
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/tools/Helper.java
Helper.getNiceScale
public static final double[] getNiceScale(final double MIN, final double MAX, final int MAX_NO_OF_TICKS) { // Minimal increment to avoid round extreme values to be on the edge of the chart double minimum = MIN; double maximum = MAX; double epsilon = (MAX - MIN) / 1e6; maximum += epsilon; minimum -= epsilon; double range = maximum - minimum; // Target number of values to be displayed on the Y axis (it may be less) int stepCount = MAX_NO_OF_TICKS; // First approximation double roughStep = range / (stepCount - 1); // Set best niceStep for the range //double[] goodNormalizedSteps = { 1, 1.5, 2, 2.5, 5, 7.5, 10 }; // keep the 10 at the end double[] goodNormalizedSteps = { 1, 2, 5, 10 }; // Normalize rough niceStep to find the normalized one that fits best double stepPower = Math.pow(10, -Math.floor(Math.log10(Math.abs(roughStep)))); double normalizedStep = roughStep * stepPower; double goodNormalizedStep = Arrays.stream(goodNormalizedSteps).filter(n -> Double.compare(n, normalizedStep) >= 0).findFirst().getAsDouble(); double niceStep = goodNormalizedStep / stepPower; // Determine the scale limits based on the chosen niceStep. double niceMin = minimum < 0 ? Math.floor(minimum / niceStep) * niceStep : Math.ceil(minimum / niceStep) * niceStep; double niceMax = maximum < 0 ? Math.floor(maximum / niceStep) * niceStep : Math.ceil(maximum / niceStep) * niceStep; if (MIN % niceStep == 0) { niceMin = MIN; } if (MAX % niceStep == 0) { niceMax = MAX; } double niceRange = niceMax - niceMin; return new double[] { niceMin, niceMax, niceRange, niceStep }; }
java
public static final double[] getNiceScale(final double MIN, final double MAX, final int MAX_NO_OF_TICKS) { // Minimal increment to avoid round extreme values to be on the edge of the chart double minimum = MIN; double maximum = MAX; double epsilon = (MAX - MIN) / 1e6; maximum += epsilon; minimum -= epsilon; double range = maximum - minimum; // Target number of values to be displayed on the Y axis (it may be less) int stepCount = MAX_NO_OF_TICKS; // First approximation double roughStep = range / (stepCount - 1); // Set best niceStep for the range //double[] goodNormalizedSteps = { 1, 1.5, 2, 2.5, 5, 7.5, 10 }; // keep the 10 at the end double[] goodNormalizedSteps = { 1, 2, 5, 10 }; // Normalize rough niceStep to find the normalized one that fits best double stepPower = Math.pow(10, -Math.floor(Math.log10(Math.abs(roughStep)))); double normalizedStep = roughStep * stepPower; double goodNormalizedStep = Arrays.stream(goodNormalizedSteps).filter(n -> Double.compare(n, normalizedStep) >= 0).findFirst().getAsDouble(); double niceStep = goodNormalizedStep / stepPower; // Determine the scale limits based on the chosen niceStep. double niceMin = minimum < 0 ? Math.floor(minimum / niceStep) * niceStep : Math.ceil(minimum / niceStep) * niceStep; double niceMax = maximum < 0 ? Math.floor(maximum / niceStep) * niceStep : Math.ceil(maximum / niceStep) * niceStep; if (MIN % niceStep == 0) { niceMin = MIN; } if (MAX % niceStep == 0) { niceMax = MAX; } double niceRange = niceMax - niceMin; return new double[] { niceMin, niceMax, niceRange, niceStep }; }
[ "public", "static", "final", "double", "[", "]", "getNiceScale", "(", "final", "double", "MIN", ",", "final", "double", "MAX", ",", "final", "int", "MAX_NO_OF_TICKS", ")", "{", "// Minimal increment to avoid round extreme values to be on the edge of the chart", "double", "minimum", "=", "MIN", ";", "double", "maximum", "=", "MAX", ";", "double", "epsilon", "=", "(", "MAX", "-", "MIN", ")", "/", "1e6", ";", "maximum", "+=", "epsilon", ";", "minimum", "-=", "epsilon", ";", "double", "range", "=", "maximum", "-", "minimum", ";", "// Target number of values to be displayed on the Y axis (it may be less)", "int", "stepCount", "=", "MAX_NO_OF_TICKS", ";", "// First approximation", "double", "roughStep", "=", "range", "/", "(", "stepCount", "-", "1", ")", ";", "// Set best niceStep for the range", "//double[] goodNormalizedSteps = { 1, 1.5, 2, 2.5, 5, 7.5, 10 }; // keep the 10 at the end", "double", "[", "]", "goodNormalizedSteps", "=", "{", "1", ",", "2", ",", "5", ",", "10", "}", ";", "// Normalize rough niceStep to find the normalized one that fits best", "double", "stepPower", "=", "Math", ".", "pow", "(", "10", ",", "-", "Math", ".", "floor", "(", "Math", ".", "log10", "(", "Math", ".", "abs", "(", "roughStep", ")", ")", ")", ")", ";", "double", "normalizedStep", "=", "roughStep", "*", "stepPower", ";", "double", "goodNormalizedStep", "=", "Arrays", ".", "stream", "(", "goodNormalizedSteps", ")", ".", "filter", "(", "n", "->", "Double", ".", "compare", "(", "n", ",", "normalizedStep", ")", ">=", "0", ")", ".", "findFirst", "(", ")", ".", "getAsDouble", "(", ")", ";", "double", "niceStep", "=", "goodNormalizedStep", "/", "stepPower", ";", "// Determine the scale limits based on the chosen niceStep.", "double", "niceMin", "=", "minimum", "<", "0", "?", "Math", ".", "floor", "(", "minimum", "/", "niceStep", ")", "*", "niceStep", ":", "Math", ".", "ceil", "(", "minimum", "/", "niceStep", ")", "*", "niceStep", ";", "double", "niceMax", "=", "maximum", "<", "0", "?", "Math", ".", "floor", "(", "maximum", "/", "niceStep", ")", "*", "niceStep", ":", "Math", ".", "ceil", "(", "maximum", "/", "niceStep", ")", "*", "niceStep", ";", "if", "(", "MIN", "%", "niceStep", "==", "0", ")", "{", "niceMin", "=", "MIN", ";", "}", "if", "(", "MAX", "%", "niceStep", "==", "0", ")", "{", "niceMax", "=", "MAX", ";", "}", "double", "niceRange", "=", "niceMax", "-", "niceMin", ";", "return", "new", "double", "[", "]", "{", "niceMin", ",", "niceMax", ",", "niceRange", ",", "niceStep", "}", ";", "}" ]
Calculates nice minValue, maxValue and stepSize for given MIN and MAX values @param MIN @param MAX @param MAX_NO_OF_TICKS @return array of doubles with [niceMin, niceMax, niceRange, niceStep]
[ "Calculates", "nice", "minValue", "maxValue", "and", "stepSize", "for", "given", "MIN", "and", "MAX", "values" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/tools/Helper.java#L455-L489
20,975
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/tools/Helper.java
Helper.calcNiceNumber
public static final double calcNiceNumber(final double RANGE, final boolean ROUND) { double niceFraction; double exponent = Math.floor(Math.log10(RANGE)); // exponent of range double fraction = RANGE / Math.pow(10, exponent); // fractional part of range if (ROUND) { if (Double.compare(fraction, 1.5) < 0) { niceFraction = 1; } else if (Double.compare(fraction, 3) < 0) { niceFraction = 2; } else if (Double.compare(fraction, 7) < 0) { niceFraction = 5; } else { niceFraction = 10; } } else { if (Double.compare(fraction, 1) <= 0) { niceFraction = 1; } else if (Double.compare(fraction, 2) <= 0) { niceFraction = 2; } else if (Double.compare(fraction, 5) <= 0) { niceFraction = 5; } else { niceFraction = 10; } } return niceFraction * Math.pow(10, exponent); }
java
public static final double calcNiceNumber(final double RANGE, final boolean ROUND) { double niceFraction; double exponent = Math.floor(Math.log10(RANGE)); // exponent of range double fraction = RANGE / Math.pow(10, exponent); // fractional part of range if (ROUND) { if (Double.compare(fraction, 1.5) < 0) { niceFraction = 1; } else if (Double.compare(fraction, 3) < 0) { niceFraction = 2; } else if (Double.compare(fraction, 7) < 0) { niceFraction = 5; } else { niceFraction = 10; } } else { if (Double.compare(fraction, 1) <= 0) { niceFraction = 1; } else if (Double.compare(fraction, 2) <= 0) { niceFraction = 2; } else if (Double.compare(fraction, 5) <= 0) { niceFraction = 5; } else { niceFraction = 10; } } return niceFraction * Math.pow(10, exponent); }
[ "public", "static", "final", "double", "calcNiceNumber", "(", "final", "double", "RANGE", ",", "final", "boolean", "ROUND", ")", "{", "double", "niceFraction", ";", "double", "exponent", "=", "Math", ".", "floor", "(", "Math", ".", "log10", "(", "RANGE", ")", ")", ";", "// exponent of range", "double", "fraction", "=", "RANGE", "/", "Math", ".", "pow", "(", "10", ",", "exponent", ")", ";", "// fractional part of range", "if", "(", "ROUND", ")", "{", "if", "(", "Double", ".", "compare", "(", "fraction", ",", "1.5", ")", "<", "0", ")", "{", "niceFraction", "=", "1", ";", "}", "else", "if", "(", "Double", ".", "compare", "(", "fraction", ",", "3", ")", "<", "0", ")", "{", "niceFraction", "=", "2", ";", "}", "else", "if", "(", "Double", ".", "compare", "(", "fraction", ",", "7", ")", "<", "0", ")", "{", "niceFraction", "=", "5", ";", "}", "else", "{", "niceFraction", "=", "10", ";", "}", "}", "else", "{", "if", "(", "Double", ".", "compare", "(", "fraction", ",", "1", ")", "<=", "0", ")", "{", "niceFraction", "=", "1", ";", "}", "else", "if", "(", "Double", ".", "compare", "(", "fraction", ",", "2", ")", "<=", "0", ")", "{", "niceFraction", "=", "2", ";", "}", "else", "if", "(", "Double", ".", "compare", "(", "fraction", ",", "5", ")", "<=", "0", ")", "{", "niceFraction", "=", "5", ";", "}", "else", "{", "niceFraction", "=", "10", ";", "}", "}", "return", "niceFraction", "*", "Math", ".", "pow", "(", "10", ",", "exponent", ")", ";", "}" ]
Returns a "niceScaling" number approximately equal to the range. Rounds the number if ROUND == true. Takes the ceiling if ROUND = false. @param RANGE the value range (maxValue - minValue) @param ROUND whether to round the result or ceil @return a "niceScaling" number to be used for the value range
[ "Returns", "a", "niceScaling", "number", "approximately", "equal", "to", "the", "range", ".", "Rounds", "the", "number", "if", "ROUND", "==", "true", ".", "Takes", "the", "ceiling", "if", "ROUND", "=", "false", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/tools/Helper.java#L530-L557
20,976
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/tools/Helper.java
Helper.smoothPath
public static final Path smoothPath(final ObservableList<PathElement> ELEMENTS, final boolean FILLED) { if (ELEMENTS.isEmpty()) { return new Path(); } final Point[] dataPoints = new Point[ELEMENTS.size()]; for (int i = 0; i < ELEMENTS.size(); i++) { final PathElement element = ELEMENTS.get(i); if (element instanceof MoveTo) { MoveTo move = (MoveTo) element; dataPoints[i] = new Point(move.getX(), move.getY()); } else if (element instanceof LineTo) { LineTo line = (LineTo) element; dataPoints[i] = new Point(line.getX(), line.getY()); } } double zeroY = ((MoveTo) ELEMENTS.get(0)).getY(); List<PathElement> smoothedElements = new ArrayList<>(); Pair<Point[], Point[]> result = calcCurveControlPoints(dataPoints); Point[] firstControlPoints = result.getKey(); Point[] secondControlPoints = result.getValue(); // Start path dependent on filled or not if (FILLED) { smoothedElements.add(new MoveTo(dataPoints[0].getX(), zeroY)); smoothedElements.add(new LineTo(dataPoints[0].getX(), dataPoints[0].getY())); } else { smoothedElements.add(new MoveTo(dataPoints[0].getX(), dataPoints[0].getY())); } // Add curves for (int i = 2; i < dataPoints.length; i++) { final int ci = i - 1; smoothedElements.add(new CubicCurveTo( firstControlPoints[ci].getX(), firstControlPoints[ci].getY(), secondControlPoints[ci].getX(), secondControlPoints[ci].getY(), dataPoints[i].getX(), dataPoints[i].getY())); } // Close the path if filled if (FILLED) { smoothedElements.add(new LineTo(dataPoints[dataPoints.length - 1].getX(), zeroY)); smoothedElements.add(new ClosePath()); } return new Path(smoothedElements); }
java
public static final Path smoothPath(final ObservableList<PathElement> ELEMENTS, final boolean FILLED) { if (ELEMENTS.isEmpty()) { return new Path(); } final Point[] dataPoints = new Point[ELEMENTS.size()]; for (int i = 0; i < ELEMENTS.size(); i++) { final PathElement element = ELEMENTS.get(i); if (element instanceof MoveTo) { MoveTo move = (MoveTo) element; dataPoints[i] = new Point(move.getX(), move.getY()); } else if (element instanceof LineTo) { LineTo line = (LineTo) element; dataPoints[i] = new Point(line.getX(), line.getY()); } } double zeroY = ((MoveTo) ELEMENTS.get(0)).getY(); List<PathElement> smoothedElements = new ArrayList<>(); Pair<Point[], Point[]> result = calcCurveControlPoints(dataPoints); Point[] firstControlPoints = result.getKey(); Point[] secondControlPoints = result.getValue(); // Start path dependent on filled or not if (FILLED) { smoothedElements.add(new MoveTo(dataPoints[0].getX(), zeroY)); smoothedElements.add(new LineTo(dataPoints[0].getX(), dataPoints[0].getY())); } else { smoothedElements.add(new MoveTo(dataPoints[0].getX(), dataPoints[0].getY())); } // Add curves for (int i = 2; i < dataPoints.length; i++) { final int ci = i - 1; smoothedElements.add(new CubicCurveTo( firstControlPoints[ci].getX(), firstControlPoints[ci].getY(), secondControlPoints[ci].getX(), secondControlPoints[ci].getY(), dataPoints[i].getX(), dataPoints[i].getY())); } // Close the path if filled if (FILLED) { smoothedElements.add(new LineTo(dataPoints[dataPoints.length - 1].getX(), zeroY)); smoothedElements.add(new ClosePath()); } return new Path(smoothedElements); }
[ "public", "static", "final", "Path", "smoothPath", "(", "final", "ObservableList", "<", "PathElement", ">", "ELEMENTS", ",", "final", "boolean", "FILLED", ")", "{", "if", "(", "ELEMENTS", ".", "isEmpty", "(", ")", ")", "{", "return", "new", "Path", "(", ")", ";", "}", "final", "Point", "[", "]", "dataPoints", "=", "new", "Point", "[", "ELEMENTS", ".", "size", "(", ")", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "ELEMENTS", ".", "size", "(", ")", ";", "i", "++", ")", "{", "final", "PathElement", "element", "=", "ELEMENTS", ".", "get", "(", "i", ")", ";", "if", "(", "element", "instanceof", "MoveTo", ")", "{", "MoveTo", "move", "=", "(", "MoveTo", ")", "element", ";", "dataPoints", "[", "i", "]", "=", "new", "Point", "(", "move", ".", "getX", "(", ")", ",", "move", ".", "getY", "(", ")", ")", ";", "}", "else", "if", "(", "element", "instanceof", "LineTo", ")", "{", "LineTo", "line", "=", "(", "LineTo", ")", "element", ";", "dataPoints", "[", "i", "]", "=", "new", "Point", "(", "line", ".", "getX", "(", ")", ",", "line", ".", "getY", "(", ")", ")", ";", "}", "}", "double", "zeroY", "=", "(", "(", "MoveTo", ")", "ELEMENTS", ".", "get", "(", "0", ")", ")", ".", "getY", "(", ")", ";", "List", "<", "PathElement", ">", "smoothedElements", "=", "new", "ArrayList", "<>", "(", ")", ";", "Pair", "<", "Point", "[", "]", ",", "Point", "[", "]", ">", "result", "=", "calcCurveControlPoints", "(", "dataPoints", ")", ";", "Point", "[", "]", "firstControlPoints", "=", "result", ".", "getKey", "(", ")", ";", "Point", "[", "]", "secondControlPoints", "=", "result", ".", "getValue", "(", ")", ";", "// Start path dependent on filled or not", "if", "(", "FILLED", ")", "{", "smoothedElements", ".", "add", "(", "new", "MoveTo", "(", "dataPoints", "[", "0", "]", ".", "getX", "(", ")", ",", "zeroY", ")", ")", ";", "smoothedElements", ".", "add", "(", "new", "LineTo", "(", "dataPoints", "[", "0", "]", ".", "getX", "(", ")", ",", "dataPoints", "[", "0", "]", ".", "getY", "(", ")", ")", ")", ";", "}", "else", "{", "smoothedElements", ".", "add", "(", "new", "MoveTo", "(", "dataPoints", "[", "0", "]", ".", "getX", "(", ")", ",", "dataPoints", "[", "0", "]", ".", "getY", "(", ")", ")", ")", ";", "}", "// Add curves", "for", "(", "int", "i", "=", "2", ";", "i", "<", "dataPoints", ".", "length", ";", "i", "++", ")", "{", "final", "int", "ci", "=", "i", "-", "1", ";", "smoothedElements", ".", "add", "(", "new", "CubicCurveTo", "(", "firstControlPoints", "[", "ci", "]", ".", "getX", "(", ")", ",", "firstControlPoints", "[", "ci", "]", ".", "getY", "(", ")", ",", "secondControlPoints", "[", "ci", "]", ".", "getX", "(", ")", ",", "secondControlPoints", "[", "ci", "]", ".", "getY", "(", ")", ",", "dataPoints", "[", "i", "]", ".", "getX", "(", ")", ",", "dataPoints", "[", "i", "]", ".", "getY", "(", ")", ")", ")", ";", "}", "// Close the path if filled", "if", "(", "FILLED", ")", "{", "smoothedElements", ".", "add", "(", "new", "LineTo", "(", "dataPoints", "[", "dataPoints", ".", "length", "-", "1", "]", ".", "getX", "(", ")", ",", "zeroY", ")", ")", ";", "smoothedElements", ".", "add", "(", "new", "ClosePath", "(", ")", ")", ";", "}", "return", "new", "Path", "(", "smoothedElements", ")", ";", "}" ]
Smooth given path defined by it's list of path elements
[ "Smooth", "given", "path", "defined", "by", "it", "s", "list", "of", "path", "elements" ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/tools/Helper.java#L878-L917
20,977
qos-ch/slf4j
jcl-over-slf4j/src/main/java/org/apache/commons/logging/impl/SimpleLog.java
SimpleLog.getContextClassLoader
private static ClassLoader getContextClassLoader() { ClassLoader classLoader = null; if (classLoader == null) { try { // Are we running on a JDK 1.2 or later system? Method method = Thread.class.getMethod("getContextClassLoader"); // Get the thread context class loader (if there is one) try { classLoader = (ClassLoader) method.invoke(Thread.currentThread()); } catch (IllegalAccessException e) { ; // ignore } catch (InvocationTargetException e) { /** * InvocationTargetException is thrown by 'invoke' when the method * being invoked (getContextClassLoader) throws an exception. * * getContextClassLoader() throws SecurityException when the context * class loader isn't an ancestor of the calling class's class loader, * or if security permissions are restricted. * * In the first case (not related), we want to ignore and keep going. * We cannot help but also ignore the second with the logic below, but * other calls elsewhere (to obtain a class loader) will trigger this * exception where we can make a distinction. */ if (e.getTargetException() instanceof SecurityException) { ; // ignore } else { // Capture 'e.getTargetException()' exception for details // alternate: log 'e.getTargetException()', and pass back 'e'. throw new LogConfigurationException("Unexpected InvocationTargetException", e.getTargetException()); } } } catch (NoSuchMethodException e) { // Assume we are running on JDK 1.1 ; // ignore } } if (classLoader == null) { classLoader = SimpleLog.class.getClassLoader(); } // Return the selected class loader return classLoader; }
java
private static ClassLoader getContextClassLoader() { ClassLoader classLoader = null; if (classLoader == null) { try { // Are we running on a JDK 1.2 or later system? Method method = Thread.class.getMethod("getContextClassLoader"); // Get the thread context class loader (if there is one) try { classLoader = (ClassLoader) method.invoke(Thread.currentThread()); } catch (IllegalAccessException e) { ; // ignore } catch (InvocationTargetException e) { /** * InvocationTargetException is thrown by 'invoke' when the method * being invoked (getContextClassLoader) throws an exception. * * getContextClassLoader() throws SecurityException when the context * class loader isn't an ancestor of the calling class's class loader, * or if security permissions are restricted. * * In the first case (not related), we want to ignore and keep going. * We cannot help but also ignore the second with the logic below, but * other calls elsewhere (to obtain a class loader) will trigger this * exception where we can make a distinction. */ if (e.getTargetException() instanceof SecurityException) { ; // ignore } else { // Capture 'e.getTargetException()' exception for details // alternate: log 'e.getTargetException()', and pass back 'e'. throw new LogConfigurationException("Unexpected InvocationTargetException", e.getTargetException()); } } } catch (NoSuchMethodException e) { // Assume we are running on JDK 1.1 ; // ignore } } if (classLoader == null) { classLoader = SimpleLog.class.getClassLoader(); } // Return the selected class loader return classLoader; }
[ "private", "static", "ClassLoader", "getContextClassLoader", "(", ")", "{", "ClassLoader", "classLoader", "=", "null", ";", "if", "(", "classLoader", "==", "null", ")", "{", "try", "{", "// Are we running on a JDK 1.2 or later system?", "Method", "method", "=", "Thread", ".", "class", ".", "getMethod", "(", "\"getContextClassLoader\"", ")", ";", "// Get the thread context class loader (if there is one)", "try", "{", "classLoader", "=", "(", "ClassLoader", ")", "method", ".", "invoke", "(", "Thread", ".", "currentThread", "(", ")", ")", ";", "}", "catch", "(", "IllegalAccessException", "e", ")", "{", ";", "// ignore", "}", "catch", "(", "InvocationTargetException", "e", ")", "{", "/**\n * InvocationTargetException is thrown by 'invoke' when the method\n * being invoked (getContextClassLoader) throws an exception.\n * \n * getContextClassLoader() throws SecurityException when the context\n * class loader isn't an ancestor of the calling class's class loader,\n * or if security permissions are restricted.\n * \n * In the first case (not related), we want to ignore and keep going.\n * We cannot help but also ignore the second with the logic below, but\n * other calls elsewhere (to obtain a class loader) will trigger this\n * exception where we can make a distinction.\n */", "if", "(", "e", ".", "getTargetException", "(", ")", "instanceof", "SecurityException", ")", "{", ";", "// ignore", "}", "else", "{", "// Capture 'e.getTargetException()' exception for details", "// alternate: log 'e.getTargetException()', and pass back 'e'.", "throw", "new", "LogConfigurationException", "(", "\"Unexpected InvocationTargetException\"", ",", "e", ".", "getTargetException", "(", ")", ")", ";", "}", "}", "}", "catch", "(", "NoSuchMethodException", "e", ")", "{", "// Assume we are running on JDK 1.1", ";", "// ignore", "}", "}", "if", "(", "classLoader", "==", "null", ")", "{", "classLoader", "=", "SimpleLog", ".", "class", ".", "getClassLoader", "(", ")", ";", "}", "// Return the selected class loader", "return", "classLoader", ";", "}" ]
Return the thread context class loader if available. Otherwise return null. The thread context class loader is available for JDK 1.2 or later, if certain security conditions are met. @exception LogConfigurationException if a suitable class loader cannot be identified.
[ "Return", "the", "thread", "context", "class", "loader", "if", "available", ".", "Otherwise", "return", "null", "." ]
905443f39fadd88a8dd2c467e44affd8cb072a4d
https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/jcl-over-slf4j/src/main/java/org/apache/commons/logging/impl/SimpleLog.java#L626-L673
20,978
qos-ch/slf4j
slf4j-api/src/main/java/org/slf4j/helpers/BasicMDCAdapter.java
BasicMDCAdapter.clear
public void clear() { Map<String, String> map = inheritableThreadLocal.get(); if (map != null) { map.clear(); inheritableThreadLocal.remove(); } }
java
public void clear() { Map<String, String> map = inheritableThreadLocal.get(); if (map != null) { map.clear(); inheritableThreadLocal.remove(); } }
[ "public", "void", "clear", "(", ")", "{", "Map", "<", "String", ",", "String", ">", "map", "=", "inheritableThreadLocal", ".", "get", "(", ")", ";", "if", "(", "map", "!=", "null", ")", "{", "map", ".", "clear", "(", ")", ";", "inheritableThreadLocal", ".", "remove", "(", ")", ";", "}", "}" ]
Clear all entries in the MDC.
[ "Clear", "all", "entries", "in", "the", "MDC", "." ]
905443f39fadd88a8dd2c467e44affd8cb072a4d
https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-api/src/main/java/org/slf4j/helpers/BasicMDCAdapter.java#L106-L112
20,979
qos-ch/slf4j
slf4j-migrator/src/main/java/org/slf4j/migrator/RuleSetFactory.java
RuleSetFactory.getMatcherImpl
public static RuleSet getMatcherImpl(int conversionType) { switch (conversionType) { case Constant.JCL_TO_SLF4J: return new JCLRuleSet(); case Constant.LOG4J_TO_SLF4J: return new Log4jRuleSet(); case Constant.JUL_TO_SLF4J: return new JULRuleSet(); case Constant.NOP_TO_SLF4J: return new EmptyRuleSet(); default: return null; } }
java
public static RuleSet getMatcherImpl(int conversionType) { switch (conversionType) { case Constant.JCL_TO_SLF4J: return new JCLRuleSet(); case Constant.LOG4J_TO_SLF4J: return new Log4jRuleSet(); case Constant.JUL_TO_SLF4J: return new JULRuleSet(); case Constant.NOP_TO_SLF4J: return new EmptyRuleSet(); default: return null; } }
[ "public", "static", "RuleSet", "getMatcherImpl", "(", "int", "conversionType", ")", "{", "switch", "(", "conversionType", ")", "{", "case", "Constant", ".", "JCL_TO_SLF4J", ":", "return", "new", "JCLRuleSet", "(", ")", ";", "case", "Constant", ".", "LOG4J_TO_SLF4J", ":", "return", "new", "Log4jRuleSet", "(", ")", ";", "case", "Constant", ".", "JUL_TO_SLF4J", ":", "return", "new", "JULRuleSet", "(", ")", ";", "case", "Constant", ".", "NOP_TO_SLF4J", ":", "return", "new", "EmptyRuleSet", "(", ")", ";", "default", ":", "return", "null", ";", "}", "}" ]
Return matcher implementation depending on the conversion mode @param conversionType @return AbstractMatcher implementation
[ "Return", "matcher", "implementation", "depending", "on", "the", "conversion", "mode" ]
905443f39fadd88a8dd2c467e44affd8cb072a4d
https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-migrator/src/main/java/org/slf4j/migrator/RuleSetFactory.java#L48-L61
20,980
qos-ch/slf4j
slf4j-ext/src/main/java/org/slf4j/instrumentation/JavassistHelper.java
JavassistHelper.methodReturnsValue
private static boolean methodReturnsValue(CtBehavior method) throws NotFoundException { if (method instanceof CtMethod == false) { return false; } CtClass returnType = ((CtMethod) method).getReturnType(); String returnTypeName = returnType.getName(); boolean isVoidMethod = "void".equals(returnTypeName); boolean methodReturnsValue = isVoidMethod == false; return methodReturnsValue; }
java
private static boolean methodReturnsValue(CtBehavior method) throws NotFoundException { if (method instanceof CtMethod == false) { return false; } CtClass returnType = ((CtMethod) method).getReturnType(); String returnTypeName = returnType.getName(); boolean isVoidMethod = "void".equals(returnTypeName); boolean methodReturnsValue = isVoidMethod == false; return methodReturnsValue; }
[ "private", "static", "boolean", "methodReturnsValue", "(", "CtBehavior", "method", ")", "throws", "NotFoundException", "{", "if", "(", "method", "instanceof", "CtMethod", "==", "false", ")", "{", "return", "false", ";", "}", "CtClass", "returnType", "=", "(", "(", "CtMethod", ")", "method", ")", ".", "getReturnType", "(", ")", ";", "String", "returnTypeName", "=", "returnType", ".", "getName", "(", ")", ";", "boolean", "isVoidMethod", "=", "\"void\"", ".", "equals", "(", "returnTypeName", ")", ";", "boolean", "methodReturnsValue", "=", "isVoidMethod", "==", "false", ";", "return", "methodReturnsValue", ";", "}" ]
determine if the given method returns a value, and return true if so. false otherwise. @param method @return @throws NotFoundException
[ "determine", "if", "the", "given", "method", "returns", "a", "value", "and", "return", "true", "if", "so", ".", "false", "otherwise", "." ]
905443f39fadd88a8dd2c467e44affd8cb072a4d
https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-ext/src/main/java/org/slf4j/instrumentation/JavassistHelper.java#L69-L82
20,981
qos-ch/slf4j
slf4j-ext/src/main/java/org/slf4j/instrumentation/JavassistHelper.java
JavassistHelper.getSignature
public static String getSignature(CtBehavior method) throws NotFoundException { CtClass[] parameterTypes = method.getParameterTypes(); CodeAttribute codeAttribute = method.getMethodInfo().getCodeAttribute(); LocalVariableAttribute locals = null; if (codeAttribute != null) { AttributeInfo attribute; attribute = codeAttribute.getAttribute("LocalVariableTable"); locals = (LocalVariableAttribute) attribute; } String methodName = method.getName(); StringBuilder sb = new StringBuilder(methodName).append("(\" "); for (int i = 0; i < parameterTypes.length; i++) { if (i > 0) { // add a comma and a space between printed values sb.append(" + \", \" "); } CtClass parameterType = parameterTypes[i]; boolean isArray = parameterType.isArray(); CtClass arrayType = parameterType.getComponentType(); if (isArray) { while (arrayType.isArray()) { arrayType = arrayType.getComponentType(); } } sb.append(" + \""); try { sb.append(parameterNameFor(method, locals, i)); } catch (Exception e) { sb.append(i + 1); } sb.append("\" + \"="); if (parameterType.isPrimitive()) { // let the compiler handle primitive -> string sb.append("\"+ $").append(i + 1); } else { String s = "org.slf4j.instrumentation.ToStringHelper.render"; sb.append("\"+ ").append(s).append("($").append(i + 1).append(')'); } } sb.append("+\")"); String signature = sb.toString(); return signature; }
java
public static String getSignature(CtBehavior method) throws NotFoundException { CtClass[] parameterTypes = method.getParameterTypes(); CodeAttribute codeAttribute = method.getMethodInfo().getCodeAttribute(); LocalVariableAttribute locals = null; if (codeAttribute != null) { AttributeInfo attribute; attribute = codeAttribute.getAttribute("LocalVariableTable"); locals = (LocalVariableAttribute) attribute; } String methodName = method.getName(); StringBuilder sb = new StringBuilder(methodName).append("(\" "); for (int i = 0; i < parameterTypes.length; i++) { if (i > 0) { // add a comma and a space between printed values sb.append(" + \", \" "); } CtClass parameterType = parameterTypes[i]; boolean isArray = parameterType.isArray(); CtClass arrayType = parameterType.getComponentType(); if (isArray) { while (arrayType.isArray()) { arrayType = arrayType.getComponentType(); } } sb.append(" + \""); try { sb.append(parameterNameFor(method, locals, i)); } catch (Exception e) { sb.append(i + 1); } sb.append("\" + \"="); if (parameterType.isPrimitive()) { // let the compiler handle primitive -> string sb.append("\"+ $").append(i + 1); } else { String s = "org.slf4j.instrumentation.ToStringHelper.render"; sb.append("\"+ ").append(s).append("($").append(i + 1).append(')'); } } sb.append("+\")"); String signature = sb.toString(); return signature; }
[ "public", "static", "String", "getSignature", "(", "CtBehavior", "method", ")", "throws", "NotFoundException", "{", "CtClass", "[", "]", "parameterTypes", "=", "method", ".", "getParameterTypes", "(", ")", ";", "CodeAttribute", "codeAttribute", "=", "method", ".", "getMethodInfo", "(", ")", ".", "getCodeAttribute", "(", ")", ";", "LocalVariableAttribute", "locals", "=", "null", ";", "if", "(", "codeAttribute", "!=", "null", ")", "{", "AttributeInfo", "attribute", ";", "attribute", "=", "codeAttribute", ".", "getAttribute", "(", "\"LocalVariableTable\"", ")", ";", "locals", "=", "(", "LocalVariableAttribute", ")", "attribute", ";", "}", "String", "methodName", "=", "method", ".", "getName", "(", ")", ";", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", "methodName", ")", ".", "append", "(", "\"(\\\" \"", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "parameterTypes", ".", "length", ";", "i", "++", ")", "{", "if", "(", "i", ">", "0", ")", "{", "// add a comma and a space between printed values", "sb", ".", "append", "(", "\" + \\\", \\\" \"", ")", ";", "}", "CtClass", "parameterType", "=", "parameterTypes", "[", "i", "]", ";", "boolean", "isArray", "=", "parameterType", ".", "isArray", "(", ")", ";", "CtClass", "arrayType", "=", "parameterType", ".", "getComponentType", "(", ")", ";", "if", "(", "isArray", ")", "{", "while", "(", "arrayType", ".", "isArray", "(", ")", ")", "{", "arrayType", "=", "arrayType", ".", "getComponentType", "(", ")", ";", "}", "}", "sb", ".", "append", "(", "\" + \\\"\"", ")", ";", "try", "{", "sb", ".", "append", "(", "parameterNameFor", "(", "method", ",", "locals", ",", "i", ")", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "sb", ".", "append", "(", "i", "+", "1", ")", ";", "}", "sb", ".", "append", "(", "\"\\\" + \\\"=\"", ")", ";", "if", "(", "parameterType", ".", "isPrimitive", "(", ")", ")", "{", "// let the compiler handle primitive -> string", "sb", ".", "append", "(", "\"\\\"+ $\"", ")", ".", "append", "(", "i", "+", "1", ")", ";", "}", "else", "{", "String", "s", "=", "\"org.slf4j.instrumentation.ToStringHelper.render\"", ";", "sb", ".", "append", "(", "\"\\\"+ \"", ")", ".", "append", "(", "s", ")", ".", "append", "(", "\"($\"", ")", ".", "append", "(", "i", "+", "1", ")", ".", "append", "(", "'", "'", ")", ";", "}", "}", "sb", ".", "append", "(", "\"+\\\")\"", ")", ";", "String", "signature", "=", "sb", ".", "toString", "(", ")", ";", "return", "signature", ";", "}" ]
Return javassist source snippet which lists all the parameters and their values. If available the source names are extracted from the debug information and used, otherwise just a number is shown. @param method @return @throws NotFoundException
[ "Return", "javassist", "source", "snippet", "which", "lists", "all", "the", "parameters", "and", "their", "values", ".", "If", "available", "the", "source", "names", "are", "extracted", "from", "the", "debug", "information", "and", "used", "otherwise", "just", "a", "number", "is", "shown", "." ]
905443f39fadd88a8dd2c467e44affd8cb072a4d
https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-ext/src/main/java/org/slf4j/instrumentation/JavassistHelper.java#L93-L145
20,982
qos-ch/slf4j
log4j-over-slf4j/src/main/java/org/apache/log4j/Level.java
Level.readObject
private void readObject(final ObjectInputStream s) throws IOException, ClassNotFoundException { s.defaultReadObject(); level = s.readInt(); syslogEquivalent = s.readInt(); levelStr = s.readUTF(); if (levelStr == null) { levelStr = ""; } }
java
private void readObject(final ObjectInputStream s) throws IOException, ClassNotFoundException { s.defaultReadObject(); level = s.readInt(); syslogEquivalent = s.readInt(); levelStr = s.readUTF(); if (levelStr == null) { levelStr = ""; } }
[ "private", "void", "readObject", "(", "final", "ObjectInputStream", "s", ")", "throws", "IOException", ",", "ClassNotFoundException", "{", "s", ".", "defaultReadObject", "(", ")", ";", "level", "=", "s", ".", "readInt", "(", ")", ";", "syslogEquivalent", "=", "s", ".", "readInt", "(", ")", ";", "levelStr", "=", "s", ".", "readUTF", "(", ")", ";", "if", "(", "levelStr", "==", "null", ")", "{", "levelStr", "=", "\"\"", ";", "}", "}" ]
Custom deserialization of Level. @param s serialization stream. @throws IOException if IO exception. @throws ClassNotFoundException if class not found.
[ "Custom", "deserialization", "of", "Level", "." ]
905443f39fadd88a8dd2c467e44affd8cb072a4d
https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/log4j-over-slf4j/src/main/java/org/apache/log4j/Level.java#L188-L196
20,983
qos-ch/slf4j
log4j-over-slf4j/src/main/java/org/apache/log4j/Level.java
Level.writeObject
private void writeObject(final ObjectOutputStream s) throws IOException { s.defaultWriteObject(); s.writeInt(level); s.writeInt(syslogEquivalent); s.writeUTF(levelStr); }
java
private void writeObject(final ObjectOutputStream s) throws IOException { s.defaultWriteObject(); s.writeInt(level); s.writeInt(syslogEquivalent); s.writeUTF(levelStr); }
[ "private", "void", "writeObject", "(", "final", "ObjectOutputStream", "s", ")", "throws", "IOException", "{", "s", ".", "defaultWriteObject", "(", ")", ";", "s", ".", "writeInt", "(", "level", ")", ";", "s", ".", "writeInt", "(", "syslogEquivalent", ")", ";", "s", ".", "writeUTF", "(", "levelStr", ")", ";", "}" ]
Serialize level. @param s serialization stream. @throws IOException if exception during serialization.
[ "Serialize", "level", "." ]
905443f39fadd88a8dd2c467e44affd8cb072a4d
https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/log4j-over-slf4j/src/main/java/org/apache/log4j/Level.java#L203-L208
20,984
qos-ch/slf4j
osgi-over-slf4j/src/main/java/org/slf4j/osgi/logservice/impl/LogServiceImpl.java
LogServiceImpl.createMessage
private String createMessage(ServiceReference sr, String message) { StringBuilder output = new StringBuilder(); if (sr != null) { output.append('[').append(sr.toString()).append(']'); } else { output.append(UNKNOWN); } output.append(message); return output.toString(); }
java
private String createMessage(ServiceReference sr, String message) { StringBuilder output = new StringBuilder(); if (sr != null) { output.append('[').append(sr.toString()).append(']'); } else { output.append(UNKNOWN); } output.append(message); return output.toString(); }
[ "private", "String", "createMessage", "(", "ServiceReference", "sr", ",", "String", "message", ")", "{", "StringBuilder", "output", "=", "new", "StringBuilder", "(", ")", ";", "if", "(", "sr", "!=", "null", ")", "{", "output", ".", "append", "(", "'", "'", ")", ".", "append", "(", "sr", ".", "toString", "(", ")", ")", ".", "append", "(", "'", "'", ")", ";", "}", "else", "{", "output", ".", "append", "(", "UNKNOWN", ")", ";", "}", "output", ".", "append", "(", "message", ")", ";", "return", "output", ".", "toString", "(", ")", ";", "}" ]
Formats the log message to indicate the service sending it, if known. @param sr the ServiceReference sending the message. @param message The message to log. @return The formatted log message.
[ "Formats", "the", "log", "message", "to", "indicate", "the", "service", "sending", "it", "if", "known", "." ]
905443f39fadd88a8dd2c467e44affd8cb072a4d
https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/osgi-over-slf4j/src/main/java/org/slf4j/osgi/logservice/impl/LogServiceImpl.java#L160-L171
20,985
qos-ch/slf4j
slf4j-api/src/main/java/org/slf4j/MDC.java
MDC.getCopyOfContextMap
public static Map<String, String> getCopyOfContextMap() { if (mdcAdapter == null) { throw new IllegalStateException("MDCAdapter cannot be null. See also " + NULL_MDCA_URL); } return mdcAdapter.getCopyOfContextMap(); }
java
public static Map<String, String> getCopyOfContextMap() { if (mdcAdapter == null) { throw new IllegalStateException("MDCAdapter cannot be null. See also " + NULL_MDCA_URL); } return mdcAdapter.getCopyOfContextMap(); }
[ "public", "static", "Map", "<", "String", ",", "String", ">", "getCopyOfContextMap", "(", ")", "{", "if", "(", "mdcAdapter", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "\"MDCAdapter cannot be null. See also \"", "+", "NULL_MDCA_URL", ")", ";", "}", "return", "mdcAdapter", ".", "getCopyOfContextMap", "(", ")", ";", "}" ]
Return a copy of the current thread's context map, with keys and values of type String. Returned value may be null. @return A copy of the current thread's context map. May be null. @since 1.5.1
[ "Return", "a", "copy", "of", "the", "current", "thread", "s", "context", "map", "with", "keys", "and", "values", "of", "type", "String", ".", "Returned", "value", "may", "be", "null", "." ]
905443f39fadd88a8dd2c467e44affd8cb072a4d
https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-api/src/main/java/org/slf4j/MDC.java#L218-L223
20,986
qos-ch/slf4j
slf4j-api/src/main/java/org/slf4j/MDC.java
MDC.setContextMap
public static void setContextMap(Map<String, String> contextMap) { if (mdcAdapter == null) { throw new IllegalStateException("MDCAdapter cannot be null. See also " + NULL_MDCA_URL); } mdcAdapter.setContextMap(contextMap); }
java
public static void setContextMap(Map<String, String> contextMap) { if (mdcAdapter == null) { throw new IllegalStateException("MDCAdapter cannot be null. See also " + NULL_MDCA_URL); } mdcAdapter.setContextMap(contextMap); }
[ "public", "static", "void", "setContextMap", "(", "Map", "<", "String", ",", "String", ">", "contextMap", ")", "{", "if", "(", "mdcAdapter", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "\"MDCAdapter cannot be null. See also \"", "+", "NULL_MDCA_URL", ")", ";", "}", "mdcAdapter", ".", "setContextMap", "(", "contextMap", ")", ";", "}" ]
Set the current thread's context map by first clearing any existing map and then copying the map passed as parameter. The context map passed as parameter must only contain keys and values of type String. @param contextMap must contain only keys and values of type String @since 1.5.1
[ "Set", "the", "current", "thread", "s", "context", "map", "by", "first", "clearing", "any", "existing", "map", "and", "then", "copying", "the", "map", "passed", "as", "parameter", ".", "The", "context", "map", "passed", "as", "parameter", "must", "only", "contain", "keys", "and", "values", "of", "type", "String", "." ]
905443f39fadd88a8dd2c467e44affd8cb072a4d
https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-api/src/main/java/org/slf4j/MDC.java#L234-L239
20,987
qos-ch/slf4j
jcl-over-slf4j/src/main/java/org/apache/commons/logging/LogFactory.java
LogFactory.newFactory
protected static LogFactory newFactory(final String factoryClass, final ClassLoader classLoader, final ClassLoader contextClassLoader) { throw new UnsupportedOperationException("Operation [logRawDiagnostic] is not supported in jcl-over-slf4j. See also " + UNSUPPORTED_OPERATION_IN_JCL_OVER_SLF4J); }
java
protected static LogFactory newFactory(final String factoryClass, final ClassLoader classLoader, final ClassLoader contextClassLoader) { throw new UnsupportedOperationException("Operation [logRawDiagnostic] is not supported in jcl-over-slf4j. See also " + UNSUPPORTED_OPERATION_IN_JCL_OVER_SLF4J); }
[ "protected", "static", "LogFactory", "newFactory", "(", "final", "String", "factoryClass", ",", "final", "ClassLoader", "classLoader", ",", "final", "ClassLoader", "contextClassLoader", ")", "{", "throw", "new", "UnsupportedOperationException", "(", "\"Operation [logRawDiagnostic] is not supported in jcl-over-slf4j. See also \"", "+", "UNSUPPORTED_OPERATION_IN_JCL_OVER_SLF4J", ")", ";", "}" ]
This method exists to ensure signature compatibility.
[ "This", "method", "exists", "to", "ensure", "signature", "compatibility", "." ]
905443f39fadd88a8dd2c467e44affd8cb072a4d
https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/jcl-over-slf4j/src/main/java/org/apache/commons/logging/LogFactory.java#L395-L398
20,988
qos-ch/slf4j
slf4j-api/src/main/java/org/slf4j/helpers/Util.java
Util.getCallingClass
public static Class<?> getCallingClass() { ClassContextSecurityManager securityManager = getSecurityManager(); if (securityManager == null) return null; Class<?>[] trace = securityManager.getClassContext(); String thisClassName = Util.class.getName(); // Advance until Util is found int i; for (i = 0; i < trace.length; i++) { if (thisClassName.equals(trace[i].getName())) break; } // trace[i] = Util; trace[i+1] = caller; trace[i+2] = caller's caller if (i >= trace.length || i + 2 >= trace.length) { throw new IllegalStateException("Failed to find org.slf4j.helpers.Util or its caller in the stack; " + "this should not happen"); } return trace[i + 2]; }
java
public static Class<?> getCallingClass() { ClassContextSecurityManager securityManager = getSecurityManager(); if (securityManager == null) return null; Class<?>[] trace = securityManager.getClassContext(); String thisClassName = Util.class.getName(); // Advance until Util is found int i; for (i = 0; i < trace.length; i++) { if (thisClassName.equals(trace[i].getName())) break; } // trace[i] = Util; trace[i+1] = caller; trace[i+2] = caller's caller if (i >= trace.length || i + 2 >= trace.length) { throw new IllegalStateException("Failed to find org.slf4j.helpers.Util or its caller in the stack; " + "this should not happen"); } return trace[i + 2]; }
[ "public", "static", "Class", "<", "?", ">", "getCallingClass", "(", ")", "{", "ClassContextSecurityManager", "securityManager", "=", "getSecurityManager", "(", ")", ";", "if", "(", "securityManager", "==", "null", ")", "return", "null", ";", "Class", "<", "?", ">", "[", "]", "trace", "=", "securityManager", ".", "getClassContext", "(", ")", ";", "String", "thisClassName", "=", "Util", ".", "class", ".", "getName", "(", ")", ";", "// Advance until Util is found", "int", "i", ";", "for", "(", "i", "=", "0", ";", "i", "<", "trace", ".", "length", ";", "i", "++", ")", "{", "if", "(", "thisClassName", ".", "equals", "(", "trace", "[", "i", "]", ".", "getName", "(", ")", ")", ")", "break", ";", "}", "// trace[i] = Util; trace[i+1] = caller; trace[i+2] = caller's caller", "if", "(", "i", ">=", "trace", ".", "length", "||", "i", "+", "2", ">=", "trace", ".", "length", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Failed to find org.slf4j.helpers.Util or its caller in the stack; \"", "+", "\"this should not happen\"", ")", ";", "}", "return", "trace", "[", "i", "+", "2", "]", ";", "}" ]
Returns the name of the class which called the invoking method. @return the name of the class which called the invoking method.
[ "Returns", "the", "name", "of", "the", "class", "which", "called", "the", "invoking", "method", "." ]
905443f39fadd88a8dd2c467e44affd8cb072a4d
https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-api/src/main/java/org/slf4j/helpers/Util.java#L99-L119
20,989
qos-ch/slf4j
slf4j-ext/src/main/java/org/slf4j/profiler/Profiler.java
Profiler.start
public void start(String name) { stopLastTimeInstrument(); StopWatch childSW = new StopWatch(name); childTimeInstrumentList.add(childSW); }
java
public void start(String name) { stopLastTimeInstrument(); StopWatch childSW = new StopWatch(name); childTimeInstrumentList.add(childSW); }
[ "public", "void", "start", "(", "String", "name", ")", "{", "stopLastTimeInstrument", "(", ")", ";", "StopWatch", "childSW", "=", "new", "StopWatch", "(", "name", ")", ";", "childTimeInstrumentList", ".", "add", "(", "childSW", ")", ";", "}" ]
Starts a child stop watch and stops any previously started time instruments.
[ "Starts", "a", "child", "stop", "watch", "and", "stops", "any", "previously", "started", "time", "instruments", "." ]
905443f39fadd88a8dd2c467e44affd8cb072a4d
https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-ext/src/main/java/org/slf4j/profiler/Profiler.java#L100-L104
20,990
qos-ch/slf4j
slf4j-ext/src/main/java/org/slf4j/profiler/Profiler.java
Profiler.sanityCheck
void sanityCheck() throws IllegalStateException { if (getStatus() != TimeInstrumentStatus.STOPPED) { throw new IllegalStateException("time instrument [" + getName() + " is not stopped"); } long totalElapsed = globalStopWatch.elapsedTime(); long childTotal = 0; for (TimeInstrument ti : childTimeInstrumentList) { childTotal += ti.elapsedTime(); if (ti.getStatus() != TimeInstrumentStatus.STOPPED) { throw new IllegalStateException("time instrument [" + ti.getName() + " is not stopped"); } if (ti instanceof Profiler) { Profiler nestedProfiler = (Profiler) ti; nestedProfiler.sanityCheck(); } } if (totalElapsed < childTotal) { throw new IllegalStateException("children have a higher accumulated elapsed time"); } }
java
void sanityCheck() throws IllegalStateException { if (getStatus() != TimeInstrumentStatus.STOPPED) { throw new IllegalStateException("time instrument [" + getName() + " is not stopped"); } long totalElapsed = globalStopWatch.elapsedTime(); long childTotal = 0; for (TimeInstrument ti : childTimeInstrumentList) { childTotal += ti.elapsedTime(); if (ti.getStatus() != TimeInstrumentStatus.STOPPED) { throw new IllegalStateException("time instrument [" + ti.getName() + " is not stopped"); } if (ti instanceof Profiler) { Profiler nestedProfiler = (Profiler) ti; nestedProfiler.sanityCheck(); } } if (totalElapsed < childTotal) { throw new IllegalStateException("children have a higher accumulated elapsed time"); } }
[ "void", "sanityCheck", "(", ")", "throws", "IllegalStateException", "{", "if", "(", "getStatus", "(", ")", "!=", "TimeInstrumentStatus", ".", "STOPPED", ")", "{", "throw", "new", "IllegalStateException", "(", "\"time instrument [\"", "+", "getName", "(", ")", "+", "\" is not stopped\"", ")", ";", "}", "long", "totalElapsed", "=", "globalStopWatch", ".", "elapsedTime", "(", ")", ";", "long", "childTotal", "=", "0", ";", "for", "(", "TimeInstrument", "ti", ":", "childTimeInstrumentList", ")", "{", "childTotal", "+=", "ti", ".", "elapsedTime", "(", ")", ";", "if", "(", "ti", ".", "getStatus", "(", ")", "!=", "TimeInstrumentStatus", ".", "STOPPED", ")", "{", "throw", "new", "IllegalStateException", "(", "\"time instrument [\"", "+", "ti", ".", "getName", "(", ")", "+", "\" is not stopped\"", ")", ";", "}", "if", "(", "ti", "instanceof", "Profiler", ")", "{", "Profiler", "nestedProfiler", "=", "(", "Profiler", ")", "ti", ";", "nestedProfiler", ".", "sanityCheck", "(", ")", ";", "}", "}", "if", "(", "totalElapsed", "<", "childTotal", ")", "{", "throw", "new", "IllegalStateException", "(", "\"children have a higher accumulated elapsed time\"", ")", ";", "}", "}" ]
This method is used in tests.
[ "This", "method", "is", "used", "in", "tests", "." ]
905443f39fadd88a8dd2c467e44affd8cb072a4d
https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-ext/src/main/java/org/slf4j/profiler/Profiler.java#L154-L175
20,991
qos-ch/slf4j
slf4j-ext/src/main/java/org/slf4j/profiler/Profiler.java
Profiler.getCopyOfChildTimeInstruments
public List<TimeInstrument> getCopyOfChildTimeInstruments() { List<TimeInstrument> copy = new ArrayList<TimeInstrument>(childTimeInstrumentList); return copy; }
java
public List<TimeInstrument> getCopyOfChildTimeInstruments() { List<TimeInstrument> copy = new ArrayList<TimeInstrument>(childTimeInstrumentList); return copy; }
[ "public", "List", "<", "TimeInstrument", ">", "getCopyOfChildTimeInstruments", "(", ")", "{", "List", "<", "TimeInstrument", ">", "copy", "=", "new", "ArrayList", "<", "TimeInstrument", ">", "(", "childTimeInstrumentList", ")", ";", "return", "copy", ";", "}" ]
Return a copy of the child instrument list for this Profiler instance. @return a copy of this instance's child time instrument list @since 1.5.9
[ "Return", "a", "copy", "of", "the", "child", "instrument", "list", "for", "this", "Profiler", "instance", "." ]
905443f39fadd88a8dd2c467e44affd8cb072a4d
https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-ext/src/main/java/org/slf4j/profiler/Profiler.java#L211-L214
20,992
qos-ch/slf4j
slf4j-log4j12/src/main/java/org/slf4j/log4j12/Log4jLoggerAdapter.java
Log4jLoggerAdapter.trace
public void trace(String msg) { logger.log(FQCN, traceCapable ? Level.TRACE : Level.DEBUG, msg, null); }
java
public void trace(String msg) { logger.log(FQCN, traceCapable ? Level.TRACE : Level.DEBUG, msg, null); }
[ "public", "void", "trace", "(", "String", "msg", ")", "{", "logger", ".", "log", "(", "FQCN", ",", "traceCapable", "?", "Level", ".", "TRACE", ":", "Level", ".", "DEBUG", ",", "msg", ",", "null", ")", ";", "}" ]
Log a message object at level TRACE. @param msg - the message object to be logged
[ "Log", "a", "message", "object", "at", "level", "TRACE", "." ]
905443f39fadd88a8dd2c467e44affd8cb072a4d
https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-log4j12/src/main/java/org/slf4j/log4j12/Log4jLoggerAdapter.java#L113-L115
20,993
qos-ch/slf4j
slf4j-log4j12/src/main/java/org/slf4j/log4j12/Log4jLoggerAdapter.java
Log4jLoggerAdapter.debug
public void debug(String format, Object arg) { if (logger.isDebugEnabled()) { FormattingTuple ft = MessageFormatter.format(format, arg); logger.log(FQCN, Level.DEBUG, ft.getMessage(), ft.getThrowable()); } }
java
public void debug(String format, Object arg) { if (logger.isDebugEnabled()) { FormattingTuple ft = MessageFormatter.format(format, arg); logger.log(FQCN, Level.DEBUG, ft.getMessage(), ft.getThrowable()); } }
[ "public", "void", "debug", "(", "String", "format", ",", "Object", "arg", ")", "{", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "{", "FormattingTuple", "ft", "=", "MessageFormatter", ".", "format", "(", "format", ",", "arg", ")", ";", "logger", ".", "log", "(", "FQCN", ",", "Level", ".", "DEBUG", ",", "ft", ".", "getMessage", "(", ")", ",", "ft", ".", "getThrowable", "(", ")", ")", ";", "}", "}" ]
Log a message at level DEBUG according to the specified format and argument. <p> This form avoids superfluous object creation when the logger is disabled for level DEBUG. </p> @param format the format string @param arg the argument
[ "Log", "a", "message", "at", "level", "DEBUG", "according", "to", "the", "specified", "format", "and", "argument", "." ]
905443f39fadd88a8dd2c467e44affd8cb072a4d
https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-log4j12/src/main/java/org/slf4j/log4j12/Log4jLoggerAdapter.java#L227-L232
20,994
qos-ch/slf4j
slf4j-log4j12/src/main/java/org/slf4j/log4j12/Log4jLoggerAdapter.java
Log4jLoggerAdapter.info
public void info(String format, Object arg) { if (logger.isInfoEnabled()) { FormattingTuple ft = MessageFormatter.format(format, arg); logger.log(FQCN, Level.INFO, ft.getMessage(), ft.getThrowable()); } }
java
public void info(String format, Object arg) { if (logger.isInfoEnabled()) { FormattingTuple ft = MessageFormatter.format(format, arg); logger.log(FQCN, Level.INFO, ft.getMessage(), ft.getThrowable()); } }
[ "public", "void", "info", "(", "String", "format", ",", "Object", "arg", ")", "{", "if", "(", "logger", ".", "isInfoEnabled", "(", ")", ")", "{", "FormattingTuple", "ft", "=", "MessageFormatter", ".", "format", "(", "format", ",", "arg", ")", ";", "logger", ".", "log", "(", "FQCN", ",", "Level", ".", "INFO", ",", "ft", ".", "getMessage", "(", ")", ",", "ft", ".", "getThrowable", "(", ")", ")", ";", "}", "}" ]
Log a message at level INFO according to the specified format and argument. <p> This form avoids superfluous object creation when the logger is disabled for the INFO level. </p> @param format the format string @param arg the argument
[ "Log", "a", "message", "at", "level", "INFO", "according", "to", "the", "specified", "format", "and", "argument", "." ]
905443f39fadd88a8dd2c467e44affd8cb072a4d
https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-log4j12/src/main/java/org/slf4j/log4j12/Log4jLoggerAdapter.java#L321-L326
20,995
qos-ch/slf4j
log4j-over-slf4j/src/main/java/org/apache/log4j/MDC.java
MDC.getContext
@SuppressWarnings({ "rawtypes", "unchecked" }) @Deprecated public static Hashtable getContext() { Map map = org.slf4j.MDC.getCopyOfContextMap(); if (map != null) { return new Hashtable(map); } else { return new Hashtable(); } }
java
@SuppressWarnings({ "rawtypes", "unchecked" }) @Deprecated public static Hashtable getContext() { Map map = org.slf4j.MDC.getCopyOfContextMap(); if (map != null) { return new Hashtable(map); } else { return new Hashtable(); } }
[ "@", "SuppressWarnings", "(", "{", "\"rawtypes\"", ",", "\"unchecked\"", "}", ")", "@", "Deprecated", "public", "static", "Hashtable", "getContext", "(", ")", "{", "Map", "map", "=", "org", ".", "slf4j", ".", "MDC", ".", "getCopyOfContextMap", "(", ")", ";", "if", "(", "map", "!=", "null", ")", "{", "return", "new", "Hashtable", "(", "map", ")", ";", "}", "else", "{", "return", "new", "Hashtable", "(", ")", ";", "}", "}" ]
This method is not part of the Log4J public API. However it has been called by other projects. This method is here temporarily until projects who are depending on this method release fixes.
[ "This", "method", "is", "not", "part", "of", "the", "Log4J", "public", "API", ".", "However", "it", "has", "been", "called", "by", "other", "projects", ".", "This", "method", "is", "here", "temporarily", "until", "projects", "who", "are", "depending", "on", "this", "method", "release", "fixes", "." ]
905443f39fadd88a8dd2c467e44affd8cb072a4d
https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/log4j-over-slf4j/src/main/java/org/apache/log4j/MDC.java#L53-L63
20,996
qos-ch/slf4j
slf4j-migrator/src/main/java/org/slf4j/migrator/line/LineConverter.java
LineConverter.getReplacement
public String[] getReplacement(String text) { ConversionRule conversionRule; Pattern pattern; Matcher matcher; Iterator<ConversionRule> conversionRuleIterator = ruleSet.iterator(); String additionalLine = null; while (conversionRuleIterator.hasNext()) { conversionRule = conversionRuleIterator.next(); pattern = conversionRule.getPattern(); matcher = pattern.matcher(text); if (matcher.find()) { // System.out.println("matching " + text); atLeastOneMatchOccured = true; String replacementText = conversionRule.replace(matcher); text = matcher.replaceAll(replacementText); if (conversionRule.getAdditionalLine() != null) { additionalLine = conversionRule.getAdditionalLine(); } } } if (additionalLine == null) { return new String[] { text }; } else { return new String[] { text, additionalLine }; } }
java
public String[] getReplacement(String text) { ConversionRule conversionRule; Pattern pattern; Matcher matcher; Iterator<ConversionRule> conversionRuleIterator = ruleSet.iterator(); String additionalLine = null; while (conversionRuleIterator.hasNext()) { conversionRule = conversionRuleIterator.next(); pattern = conversionRule.getPattern(); matcher = pattern.matcher(text); if (matcher.find()) { // System.out.println("matching " + text); atLeastOneMatchOccured = true; String replacementText = conversionRule.replace(matcher); text = matcher.replaceAll(replacementText); if (conversionRule.getAdditionalLine() != null) { additionalLine = conversionRule.getAdditionalLine(); } } } if (additionalLine == null) { return new String[] { text }; } else { return new String[] { text, additionalLine }; } }
[ "public", "String", "[", "]", "getReplacement", "(", "String", "text", ")", "{", "ConversionRule", "conversionRule", ";", "Pattern", "pattern", ";", "Matcher", "matcher", ";", "Iterator", "<", "ConversionRule", ">", "conversionRuleIterator", "=", "ruleSet", ".", "iterator", "(", ")", ";", "String", "additionalLine", "=", "null", ";", "while", "(", "conversionRuleIterator", ".", "hasNext", "(", ")", ")", "{", "conversionRule", "=", "conversionRuleIterator", ".", "next", "(", ")", ";", "pattern", "=", "conversionRule", ".", "getPattern", "(", ")", ";", "matcher", "=", "pattern", ".", "matcher", "(", "text", ")", ";", "if", "(", "matcher", ".", "find", "(", ")", ")", "{", "// System.out.println(\"matching \" + text);", "atLeastOneMatchOccured", "=", "true", ";", "String", "replacementText", "=", "conversionRule", ".", "replace", "(", "matcher", ")", ";", "text", "=", "matcher", ".", "replaceAll", "(", "replacementText", ")", ";", "if", "(", "conversionRule", ".", "getAdditionalLine", "(", ")", "!=", "null", ")", "{", "additionalLine", "=", "conversionRule", ".", "getAdditionalLine", "(", ")", ";", "}", "}", "}", "if", "(", "additionalLine", "==", "null", ")", "{", "return", "new", "String", "[", "]", "{", "text", "}", ";", "}", "else", "{", "return", "new", "String", "[", "]", "{", "text", ",", "additionalLine", "}", ";", "}", "}" ]
Check if the specified text is matching some conversions rules. If a rule matches, ask for line replacement. <p>In case no rule can be applied, then the input text is returned without change. @param text @return String
[ "Check", "if", "the", "specified", "text", "is", "matching", "some", "conversions", "rules", ".", "If", "a", "rule", "matches", "ask", "for", "line", "replacement", "." ]
905443f39fadd88a8dd2c467e44affd8cb072a4d
https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-migrator/src/main/java/org/slf4j/migrator/line/LineConverter.java#L51-L77
20,997
qos-ch/slf4j
slf4j-ext/src/main/java/org/slf4j/cal10n/LocLogger.java
LocLogger.trace
public void trace(Enum<?> key, Object... args) { if (!logger.isTraceEnabled()) { return; } String translatedMsg = imc.getMessage(key, args); MessageParameterObj mpo = new MessageParameterObj(key, args); if (instanceofLAL) { ((LocationAwareLogger) logger).log(LOCALIZED, FQCN, LocationAwareLogger.TRACE_INT, translatedMsg, args, null); } else { logger.trace(LOCALIZED, translatedMsg, mpo); } }
java
public void trace(Enum<?> key, Object... args) { if (!logger.isTraceEnabled()) { return; } String translatedMsg = imc.getMessage(key, args); MessageParameterObj mpo = new MessageParameterObj(key, args); if (instanceofLAL) { ((LocationAwareLogger) logger).log(LOCALIZED, FQCN, LocationAwareLogger.TRACE_INT, translatedMsg, args, null); } else { logger.trace(LOCALIZED, translatedMsg, mpo); } }
[ "public", "void", "trace", "(", "Enum", "<", "?", ">", "key", ",", "Object", "...", "args", ")", "{", "if", "(", "!", "logger", ".", "isTraceEnabled", "(", ")", ")", "{", "return", ";", "}", "String", "translatedMsg", "=", "imc", ".", "getMessage", "(", "key", ",", "args", ")", ";", "MessageParameterObj", "mpo", "=", "new", "MessageParameterObj", "(", "key", ",", "args", ")", ";", "if", "(", "instanceofLAL", ")", "{", "(", "(", "LocationAwareLogger", ")", "logger", ")", ".", "log", "(", "LOCALIZED", ",", "FQCN", ",", "LocationAwareLogger", ".", "TRACE_INT", ",", "translatedMsg", ",", "args", ",", "null", ")", ";", "}", "else", "{", "logger", ".", "trace", "(", "LOCALIZED", ",", "translatedMsg", ",", "mpo", ")", ";", "}", "}" ]
Log a localized message at the TRACE level. @param key the key used for localization @param args optional arguments
[ "Log", "a", "localized", "message", "at", "the", "TRACE", "level", "." ]
905443f39fadd88a8dd2c467e44affd8cb072a4d
https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-ext/src/main/java/org/slf4j/cal10n/LocLogger.java#L71-L83
20,998
qos-ch/slf4j
slf4j-ext/src/main/java/org/slf4j/cal10n/LocLogger.java
LocLogger.debug
public void debug(Enum<?> key, Object... args) { if (!logger.isDebugEnabled()) { return; } String translatedMsg = imc.getMessage(key, args); MessageParameterObj mpo = new MessageParameterObj(key, args); if (instanceofLAL) { ((LocationAwareLogger) logger).log(LOCALIZED, FQCN, LocationAwareLogger.DEBUG_INT, translatedMsg, args, null); } else { logger.debug(LOCALIZED, translatedMsg, mpo); } }
java
public void debug(Enum<?> key, Object... args) { if (!logger.isDebugEnabled()) { return; } String translatedMsg = imc.getMessage(key, args); MessageParameterObj mpo = new MessageParameterObj(key, args); if (instanceofLAL) { ((LocationAwareLogger) logger).log(LOCALIZED, FQCN, LocationAwareLogger.DEBUG_INT, translatedMsg, args, null); } else { logger.debug(LOCALIZED, translatedMsg, mpo); } }
[ "public", "void", "debug", "(", "Enum", "<", "?", ">", "key", ",", "Object", "...", "args", ")", "{", "if", "(", "!", "logger", ".", "isDebugEnabled", "(", ")", ")", "{", "return", ";", "}", "String", "translatedMsg", "=", "imc", ".", "getMessage", "(", "key", ",", "args", ")", ";", "MessageParameterObj", "mpo", "=", "new", "MessageParameterObj", "(", "key", ",", "args", ")", ";", "if", "(", "instanceofLAL", ")", "{", "(", "(", "LocationAwareLogger", ")", "logger", ")", ".", "log", "(", "LOCALIZED", ",", "FQCN", ",", "LocationAwareLogger", ".", "DEBUG_INT", ",", "translatedMsg", ",", "args", ",", "null", ")", ";", "}", "else", "{", "logger", ".", "debug", "(", "LOCALIZED", ",", "translatedMsg", ",", "mpo", ")", ";", "}", "}" ]
Log a localized message at the DEBUG level. @param key the key used for localization @param args optional arguments
[ "Log", "a", "localized", "message", "at", "the", "DEBUG", "level", "." ]
905443f39fadd88a8dd2c467e44affd8cb072a4d
https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-ext/src/main/java/org/slf4j/cal10n/LocLogger.java#L93-L105
20,999
qos-ch/slf4j
slf4j-ext/src/main/java/org/slf4j/cal10n/LocLogger.java
LocLogger.info
public void info(Enum<?> key, Object... args) { if (!logger.isInfoEnabled()) { return; } String translatedMsg = imc.getMessage(key, args); MessageParameterObj mpo = new MessageParameterObj(key, args); if (instanceofLAL) { ((LocationAwareLogger) logger).log(LOCALIZED, FQCN, LocationAwareLogger.INFO_INT, translatedMsg, args, null); } else { logger.info(LOCALIZED, translatedMsg, mpo); } }
java
public void info(Enum<?> key, Object... args) { if (!logger.isInfoEnabled()) { return; } String translatedMsg = imc.getMessage(key, args); MessageParameterObj mpo = new MessageParameterObj(key, args); if (instanceofLAL) { ((LocationAwareLogger) logger).log(LOCALIZED, FQCN, LocationAwareLogger.INFO_INT, translatedMsg, args, null); } else { logger.info(LOCALIZED, translatedMsg, mpo); } }
[ "public", "void", "info", "(", "Enum", "<", "?", ">", "key", ",", "Object", "...", "args", ")", "{", "if", "(", "!", "logger", ".", "isInfoEnabled", "(", ")", ")", "{", "return", ";", "}", "String", "translatedMsg", "=", "imc", ".", "getMessage", "(", "key", ",", "args", ")", ";", "MessageParameterObj", "mpo", "=", "new", "MessageParameterObj", "(", "key", ",", "args", ")", ";", "if", "(", "instanceofLAL", ")", "{", "(", "(", "LocationAwareLogger", ")", "logger", ")", ".", "log", "(", "LOCALIZED", ",", "FQCN", ",", "LocationAwareLogger", ".", "INFO_INT", ",", "translatedMsg", ",", "args", ",", "null", ")", ";", "}", "else", "{", "logger", ".", "info", "(", "LOCALIZED", ",", "translatedMsg", ",", "mpo", ")", ";", "}", "}" ]
Log a localized message at the INFO level. @param key the key used for localization @param args optional arguments
[ "Log", "a", "localized", "message", "at", "the", "INFO", "level", "." ]
905443f39fadd88a8dd2c467e44affd8cb072a4d
https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-ext/src/main/java/org/slf4j/cal10n/LocLogger.java#L115-L127