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
3,300
GwtMaterialDesign/gwt-material-addins
src/main/java/gwt/material/design/addins/client/splitpanel/MaterialSplitPanel.java
MaterialSplitPanel.getAxis
public Axis getAxis() { return options.orientation != null ? Axis.fromStyleName(options.orientation) : null; }
java
public Axis getAxis() { return options.orientation != null ? Axis.fromStyleName(options.orientation) : null; }
[ "public", "Axis", "getAxis", "(", ")", "{", "return", "options", ".", "orientation", "!=", "null", "?", "Axis", ".", "fromStyleName", "(", "options", ".", "orientation", ")", ":", "null", ";", "}" ]
Get the axis orientation of splitter component.
[ "Get", "the", "axis", "orientation", "of", "splitter", "component", "." ]
11aec9d92918225f70f936285d0ae94f2178c36e
https://github.com/GwtMaterialDesign/gwt-material-addins/blob/11aec9d92918225f70f936285d0ae94f2178c36e/src/main/java/gwt/material/design/addins/client/splitpanel/MaterialSplitPanel.java#L284-L286
3,301
GwtMaterialDesign/gwt-material-addins
src/main/java/gwt/material/design/addins/client/splitpanel/MaterialSplitPanel.java
MaterialSplitPanel.getDock
public Dock getDock() { return options.dock != null ? Dock.fromStyleName(options.dock) : null; }
java
public Dock getDock() { return options.dock != null ? Dock.fromStyleName(options.dock) : null; }
[ "public", "Dock", "getDock", "(", ")", "{", "return", "options", ".", "dock", "!=", "null", "?", "Dock", ".", "fromStyleName", "(", "options", ".", "dock", ")", ":", "null", ";", "}" ]
Get the dock value.
[ "Get", "the", "dock", "value", "." ]
11aec9d92918225f70f936285d0ae94f2178c36e
https://github.com/GwtMaterialDesign/gwt-material-addins/blob/11aec9d92918225f70f936285d0ae94f2178c36e/src/main/java/gwt/material/design/addins/client/splitpanel/MaterialSplitPanel.java#L298-L300
3,302
GwtMaterialDesign/gwt-material-addins
src/main/java/gwt/material/design/addins/client/combobox/MaterialComboBox.java
MaterialComboBox.addItem
public void addItem(String text, T value, OptGroup optGroup) { if (!values.contains(value)) { values.add(value); optGroup.add(buildOption(text, value)); } }
java
public void addItem(String text, T value, OptGroup optGroup) { if (!values.contains(value)) { values.add(value); optGroup.add(buildOption(text, value)); } }
[ "public", "void", "addItem", "(", "String", "text", ",", "T", "value", ",", "OptGroup", "optGroup", ")", "{", "if", "(", "!", "values", ".", "contains", "(", "value", ")", ")", "{", "values", ".", "add", "(", "value", ")", ";", "optGroup", ".", "ad...
Add item directly to combobox component with existing OptGroup @param text - The text you want to labeled on the option item @param value - The value you want to pass through in this option @param optGroup - Add directly this option into the existing group
[ "Add", "item", "directly", "to", "combobox", "component", "with", "existing", "OptGroup" ]
11aec9d92918225f70f936285d0ae94f2178c36e
https://github.com/GwtMaterialDesign/gwt-material-addins/blob/11aec9d92918225f70f936285d0ae94f2178c36e/src/main/java/gwt/material/design/addins/client/combobox/MaterialComboBox.java#L237-L242
3,303
GwtMaterialDesign/gwt-material-addins
src/main/java/gwt/material/design/addins/client/combobox/MaterialComboBox.java
MaterialComboBox.addItem
public Option addItem(String text, T value) { if (!values.contains(value)) { Option option = buildOption(text, value); values.add(value); listbox.add(option); return option; } return null; }
java
public Option addItem(String text, T value) { if (!values.contains(value)) { Option option = buildOption(text, value); values.add(value); listbox.add(option); return option; } return null; }
[ "public", "Option", "addItem", "(", "String", "text", ",", "T", "value", ")", "{", "if", "(", "!", "values", ".", "contains", "(", "value", ")", ")", "{", "Option", "option", "=", "buildOption", "(", "text", ",", "value", ")", ";", "values", ".", "...
Add Value directly to combobox component @param text - The text you want to labeled on the option item @param value - The value you want to pass through in this option
[ "Add", "Value", "directly", "to", "combobox", "component" ]
11aec9d92918225f70f936285d0ae94f2178c36e
https://github.com/GwtMaterialDesign/gwt-material-addins/blob/11aec9d92918225f70f936285d0ae94f2178c36e/src/main/java/gwt/material/design/addins/client/combobox/MaterialComboBox.java#L250-L258
3,304
GwtMaterialDesign/gwt-material-addins
src/main/java/gwt/material/design/addins/client/combobox/MaterialComboBox.java
MaterialComboBox.buildOption
protected Option buildOption(String text, T value) { Option option = new Option(); option.setText(text); option.setValue(keyFactory.generateKey(value)); return option; }
java
protected Option buildOption(String text, T value) { Option option = new Option(); option.setText(text); option.setValue(keyFactory.generateKey(value)); return option; }
[ "protected", "Option", "buildOption", "(", "String", "text", ",", "T", "value", ")", "{", "Option", "option", "=", "new", "Option", "(", ")", ";", "option", ".", "setText", "(", "text", ")", ";", "option", ".", "setValue", "(", "keyFactory", ".", "gene...
Build the Option Element with provided params
[ "Build", "the", "Option", "Element", "with", "provided", "params" ]
11aec9d92918225f70f936285d0ae94f2178c36e
https://github.com/GwtMaterialDesign/gwt-material-addins/blob/11aec9d92918225f70f936285d0ae94f2178c36e/src/main/java/gwt/material/design/addins/client/combobox/MaterialComboBox.java#L276-L281
3,305
GwtMaterialDesign/gwt-material-addins
src/main/java/gwt/material/design/addins/client/combobox/MaterialComboBox.java
MaterialComboBox.getSingleValue
public T getSingleValue() { List<T> values = getSelectedValue(); if (!values.isEmpty()) { return values.get(0); } return null; }
java
public T getSingleValue() { List<T> values = getSelectedValue(); if (!values.isEmpty()) { return values.get(0); } return null; }
[ "public", "T", "getSingleValue", "(", ")", "{", "List", "<", "T", ">", "values", "=", "getSelectedValue", "(", ")", ";", "if", "(", "!", "values", ".", "isEmpty", "(", ")", ")", "{", "return", "values", ".", "get", "(", "0", ")", ";", "}", "retur...
Only return a single value even if multi support is activate.
[ "Only", "return", "a", "single", "value", "even", "if", "multi", "support", "is", "activate", "." ]
11aec9d92918225f70f936285d0ae94f2178c36e
https://github.com/GwtMaterialDesign/gwt-material-addins/blob/11aec9d92918225f70f936285d0ae94f2178c36e/src/main/java/gwt/material/design/addins/client/combobox/MaterialComboBox.java#L497-L503
3,306
GwtMaterialDesign/gwt-material-addins
src/main/java/gwt/material/design/addins/client/combobox/MaterialComboBox.java
MaterialComboBox.setSingleValue
public void setSingleValue(T value, boolean fireEvents) { int index = this.values.indexOf(value); if (index < 0 && value instanceof String) { index = getIndexByString((String) value); } if (index > -1) { List<T> before = getValue(); setSelectedIndex(i...
java
public void setSingleValue(T value, boolean fireEvents) { int index = this.values.indexOf(value); if (index < 0 && value instanceof String) { index = getIndexByString((String) value); } if (index > -1) { List<T> before = getValue(); setSelectedIndex(i...
[ "public", "void", "setSingleValue", "(", "T", "value", ",", "boolean", "fireEvents", ")", "{", "int", "index", "=", "this", ".", "values", ".", "indexOf", "(", "value", ")", ";", "if", "(", "index", "<", "0", "&&", "value", "instanceof", "String", ")",...
Set the selected value using a single item, generally used in single selection mode.
[ "Set", "the", "selected", "value", "using", "a", "single", "item", "generally", "used", "in", "single", "selection", "mode", "." ]
11aec9d92918225f70f936285d0ae94f2178c36e
https://github.com/GwtMaterialDesign/gwt-material-addins/blob/11aec9d92918225f70f936285d0ae94f2178c36e/src/main/java/gwt/material/design/addins/client/combobox/MaterialComboBox.java#L533-L547
3,307
GwtMaterialDesign/gwt-material-addins
src/main/java/gwt/material/design/addins/client/circularprogress/MaterialCircularProgress.java
MaterialCircularProgress.setFillColor
public void setFillColor(Color fillColor) { this.fillColor = fillColor; options.fill = ColorHelper.setupComputedBackgroundColor(fillColor); }
java
public void setFillColor(Color fillColor) { this.fillColor = fillColor; options.fill = ColorHelper.setupComputedBackgroundColor(fillColor); }
[ "public", "void", "setFillColor", "(", "Color", "fillColor", ")", "{", "this", ".", "fillColor", "=", "fillColor", ";", "options", ".", "fill", "=", "ColorHelper", ".", "setupComputedBackgroundColor", "(", "fillColor", ")", ";", "}" ]
Set the fillColor of the circular progress
[ "Set", "the", "fillColor", "of", "the", "circular", "progress" ]
11aec9d92918225f70f936285d0ae94f2178c36e
https://github.com/GwtMaterialDesign/gwt-material-addins/blob/11aec9d92918225f70f936285d0ae94f2178c36e/src/main/java/gwt/material/design/addins/client/circularprogress/MaterialCircularProgress.java#L184-L187
3,308
GwtMaterialDesign/gwt-material-addins
src/main/java/gwt/material/design/addins/client/circularprogress/MaterialCircularProgress.java
MaterialCircularProgress.setEmptyFillColor
public void setEmptyFillColor(Color emptyFillColor) { this.emptyFillColor = emptyFillColor; options.emptyFill = ColorHelper.setupComputedBackgroundColor(emptyFillColor); }
java
public void setEmptyFillColor(Color emptyFillColor) { this.emptyFillColor = emptyFillColor; options.emptyFill = ColorHelper.setupComputedBackgroundColor(emptyFillColor); }
[ "public", "void", "setEmptyFillColor", "(", "Color", "emptyFillColor", ")", "{", "this", ".", "emptyFillColor", "=", "emptyFillColor", ";", "options", ".", "emptyFill", "=", "ColorHelper", ".", "setupComputedBackgroundColor", "(", "emptyFillColor", ")", ";", "}" ]
Set the empty fill color of the circular progress
[ "Set", "the", "empty", "fill", "color", "of", "the", "circular", "progress" ]
11aec9d92918225f70f936285d0ae94f2178c36e
https://github.com/GwtMaterialDesign/gwt-material-addins/blob/11aec9d92918225f70f936285d0ae94f2178c36e/src/main/java/gwt/material/design/addins/client/circularprogress/MaterialCircularProgress.java#L196-L199
3,309
GwtMaterialDesign/gwt-material-addins
src/main/java/gwt/material/design/addins/client/autocomplete/base/MaterialSuggestionOracle.java
MaterialSuggestionOracle.add
public void add(String text, Image image) { this.imageElem = image.getElement().toString(); add(text + image); }
java
public void add(String text, Image image) { this.imageElem = image.getElement().toString(); add(text + image); }
[ "public", "void", "add", "(", "String", "text", ",", "Image", "image", ")", "{", "this", ".", "imageElem", "=", "image", ".", "getElement", "(", ")", ".", "toString", "(", ")", ";", "add", "(", "text", "+", "image", ")", ";", "}" ]
Autocomplete with Image item selection.
[ "Autocomplete", "with", "Image", "item", "selection", "." ]
11aec9d92918225f70f936285d0ae94f2178c36e
https://github.com/GwtMaterialDesign/gwt-material-addins/blob/11aec9d92918225f70f936285d0ae94f2178c36e/src/main/java/gwt/material/design/addins/client/autocomplete/base/MaterialSuggestionOracle.java#L40-L43
3,310
GwtMaterialDesign/gwt-material-addins
src/main/java/gwt/material/design/incubator/client/infinitescroll/recycle/RecycleManager.java
RecycleManager.recycle
public void recycle(RecyclePosition position) { stubCount = determineStubCount(); switch (position) { case BOTTOM: if (hasRecycledWidgets()) { // Will remove the current recycled widgets remove(getRecycledWidgets().stream() ...
java
public void recycle(RecyclePosition position) { stubCount = determineStubCount(); switch (position) { case BOTTOM: if (hasRecycledWidgets()) { // Will remove the current recycled widgets remove(getRecycledWidgets().stream() ...
[ "public", "void", "recycle", "(", "RecyclePosition", "position", ")", "{", "stubCount", "=", "determineStubCount", "(", ")", ";", "switch", "(", "position", ")", "{", "case", "BOTTOM", ":", "if", "(", "hasRecycledWidgets", "(", ")", ")", "{", "// Will remove...
Will recycle the provided widgets (@link widgets} with provided {@link RecyclePosition}
[ "Will", "recycle", "the", "provided", "widgets", "(" ]
11aec9d92918225f70f936285d0ae94f2178c36e
https://github.com/GwtMaterialDesign/gwt-material-addins/blob/11aec9d92918225f70f936285d0ae94f2178c36e/src/main/java/gwt/material/design/incubator/client/infinitescroll/recycle/RecycleManager.java#L63-L101
3,311
GwtMaterialDesign/gwt-material-addins
src/main/java/gwt/material/design/incubator/client/infinitescroll/recycle/RecycleManager.java
RecycleManager.getRecycledWidgets
public List<Widget> getRecycledWidgets() { List<Widget> widgets = new ArrayList<>(); for (Integer recycledIndex : recycledWidgets.keySet()) { widgets.addAll(recycledWidgets.get(recycledIndex)); } return widgets; }
java
public List<Widget> getRecycledWidgets() { List<Widget> widgets = new ArrayList<>(); for (Integer recycledIndex : recycledWidgets.keySet()) { widgets.addAll(recycledWidgets.get(recycledIndex)); } return widgets; }
[ "public", "List", "<", "Widget", ">", "getRecycledWidgets", "(", ")", "{", "List", "<", "Widget", ">", "widgets", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "Integer", "recycledIndex", ":", "recycledWidgets", ".", "keySet", "(", ")", ")", ...
Get all recycled widgets
[ "Get", "all", "recycled", "widgets" ]
11aec9d92918225f70f936285d0ae94f2178c36e
https://github.com/GwtMaterialDesign/gwt-material-addins/blob/11aec9d92918225f70f936285d0ae94f2178c36e/src/main/java/gwt/material/design/incubator/client/infinitescroll/recycle/RecycleManager.java#L180-L186
3,312
Jasig/sass-maven-plugin
src/main/java/org/jasig/maven/plugin/sass/AbstractSassMojo.java
AbstractSassMojo.executeSassScript
protected void executeSassScript(String sassScript) throws MojoExecutionException, MojoFailureException { final Log log = this.getLog(); System.setProperty("org.jruby.embed.localcontext.scope", "threadsafe"); log.debug("Execute SASS Ruby Script:\n" + sassScript); final ScriptEngineMana...
java
protected void executeSassScript(String sassScript) throws MojoExecutionException, MojoFailureException { final Log log = this.getLog(); System.setProperty("org.jruby.embed.localcontext.scope", "threadsafe"); log.debug("Execute SASS Ruby Script:\n" + sassScript); final ScriptEngineMana...
[ "protected", "void", "executeSassScript", "(", "String", "sassScript", ")", "throws", "MojoExecutionException", ",", "MojoFailureException", "{", "final", "Log", "log", "=", "this", ".", "getLog", "(", ")", ";", "System", ".", "setProperty", "(", "\"org.jruby.embe...
Execute the SASS Compilation Ruby Script
[ "Execute", "the", "SASS", "Compilation", "Ruby", "Script" ]
d57bc14748dd25a83eb73172b646436ffc983ed9
https://github.com/Jasig/sass-maven-plugin/blob/d57bc14748dd25a83eb73172b646436ffc983ed9/src/main/java/org/jasig/maven/plugin/sass/AbstractSassMojo.java#L180-L199
3,313
Karumi/HeaderRecyclerView
library/src/main/java/com/karumi/headerrecyclerview/HeaderRecyclerViewAdapter.java
HeaderRecyclerViewAdapter.onCreateViewHolder
@Override public final VH onCreateViewHolder(ViewGroup parent, int viewType) { VH viewHolder; if (isHeaderType(viewType)) { viewHolder = onCreateHeaderViewHolder(parent, viewType); } else if (isFooterType(viewType)) { viewHolder = onCreateFooterViewHolder(parent, viewType); } else { vi...
java
@Override public final VH onCreateViewHolder(ViewGroup parent, int viewType) { VH viewHolder; if (isHeaderType(viewType)) { viewHolder = onCreateHeaderViewHolder(parent, viewType); } else if (isFooterType(viewType)) { viewHolder = onCreateFooterViewHolder(parent, viewType); } else { vi...
[ "@", "Override", "public", "final", "VH", "onCreateViewHolder", "(", "ViewGroup", "parent", ",", "int", "viewType", ")", "{", "VH", "viewHolder", ";", "if", "(", "isHeaderType", "(", "viewType", ")", ")", "{", "viewHolder", "=", "onCreateHeaderViewHolder", "("...
Invokes onCreateHeaderViewHolder, onCreateItemViewHolder or onCreateFooterViewHolder methods based on the view type param.
[ "Invokes", "onCreateHeaderViewHolder", "onCreateItemViewHolder", "or", "onCreateFooterViewHolder", "methods", "based", "on", "the", "view", "type", "param", "." ]
c018472a1b15de661d8aec153bd5f555ef1e9a37
https://github.com/Karumi/HeaderRecyclerView/blob/c018472a1b15de661d8aec153bd5f555ef1e9a37/library/src/main/java/com/karumi/headerrecyclerview/HeaderRecyclerViewAdapter.java#L49-L59
3,314
Karumi/HeaderRecyclerView
library/src/main/java/com/karumi/headerrecyclerview/HeaderRecyclerViewAdapter.java
HeaderRecyclerViewAdapter.onBindViewHolder
@Override public final void onBindViewHolder(VH holder, int position) { if (isHeaderPosition(position)) { onBindHeaderViewHolder(holder, position); } else if (isFooterPosition(position)) { onBindFooterViewHolder(holder, position); } else { onBindItemViewHolder(holder, position); } }
java
@Override public final void onBindViewHolder(VH holder, int position) { if (isHeaderPosition(position)) { onBindHeaderViewHolder(holder, position); } else if (isFooterPosition(position)) { onBindFooterViewHolder(holder, position); } else { onBindItemViewHolder(holder, position); } }
[ "@", "Override", "public", "final", "void", "onBindViewHolder", "(", "VH", "holder", ",", "int", "position", ")", "{", "if", "(", "isHeaderPosition", "(", "position", ")", ")", "{", "onBindHeaderViewHolder", "(", "holder", ",", "position", ")", ";", "}", "...
Invokes onBindHeaderViewHolder, onBindItemViewHolder or onBindFooterViewHOlder methods based on the position param.
[ "Invokes", "onBindHeaderViewHolder", "onBindItemViewHolder", "or", "onBindFooterViewHOlder", "methods", "based", "on", "the", "position", "param", "." ]
c018472a1b15de661d8aec153bd5f555ef1e9a37
https://github.com/Karumi/HeaderRecyclerView/blob/c018472a1b15de661d8aec153bd5f555ef1e9a37/library/src/main/java/com/karumi/headerrecyclerview/HeaderRecyclerViewAdapter.java#L81-L89
3,315
Karumi/HeaderRecyclerView
library/src/main/java/com/karumi/headerrecyclerview/HeaderRecyclerViewAdapter.java
HeaderRecyclerViewAdapter.getItemViewType
@Override public int getItemViewType(int position) { int viewType = TYPE_ITEM; if (isHeaderPosition(position)) { viewType = TYPE_HEADER; } else if (isFooterPosition(position)) { viewType = TYPE_FOOTER; } return viewType; }
java
@Override public int getItemViewType(int position) { int viewType = TYPE_ITEM; if (isHeaderPosition(position)) { viewType = TYPE_HEADER; } else if (isFooterPosition(position)) { viewType = TYPE_FOOTER; } return viewType; }
[ "@", "Override", "public", "int", "getItemViewType", "(", "int", "position", ")", "{", "int", "viewType", "=", "TYPE_ITEM", ";", "if", "(", "isHeaderPosition", "(", "position", ")", ")", "{", "viewType", "=", "TYPE_HEADER", ";", "}", "else", "if", "(", "...
Returns the type associated to an item given a position passed as arguments. If the position is related to a header item returns the constant TYPE_HEADER or TYPE_FOOTER if the position is related to the footer, if not, returns TYPE_ITEM. If your application has to support different types override this method and provi...
[ "Returns", "the", "type", "associated", "to", "an", "item", "given", "a", "position", "passed", "as", "arguments", ".", "If", "the", "position", "is", "related", "to", "a", "header", "item", "returns", "the", "constant", "TYPE_HEADER", "or", "TYPE_FOOTER", "...
c018472a1b15de661d8aec153bd5f555ef1e9a37
https://github.com/Karumi/HeaderRecyclerView/blob/c018472a1b15de661d8aec153bd5f555ef1e9a37/library/src/main/java/com/karumi/headerrecyclerview/HeaderRecyclerViewAdapter.java#L140-L148
3,316
Karumi/HeaderRecyclerView
library/src/main/java/com/karumi/headerrecyclerview/HeaderRecyclerViewAdapter.java
HeaderRecyclerViewAdapter.getItemCount
@Override public int getItemCount() { int size = items.size(); if (hasHeader()) { size++; } if (hasFooter()) { size++; } return size; }
java
@Override public int getItemCount() { int size = items.size(); if (hasHeader()) { size++; } if (hasFooter()) { size++; } return size; }
[ "@", "Override", "public", "int", "getItemCount", "(", ")", "{", "int", "size", "=", "items", ".", "size", "(", ")", ";", "if", "(", "hasHeader", "(", ")", ")", "{", "size", "++", ";", "}", "if", "(", "hasFooter", "(", ")", ")", "{", "size", "+...
Returns the items list size if there is no a header configured or the size taking into account that if a header or a footer is configured the number of items returned is going to include this elements.
[ "Returns", "the", "items", "list", "size", "if", "there", "is", "no", "a", "header", "configured", "or", "the", "size", "taking", "into", "account", "that", "if", "a", "header", "or", "a", "footer", "is", "configured", "the", "number", "of", "items", "re...
c018472a1b15de661d8aec153bd5f555ef1e9a37
https://github.com/Karumi/HeaderRecyclerView/blob/c018472a1b15de661d8aec153bd5f555ef1e9a37/library/src/main/java/com/karumi/headerrecyclerview/HeaderRecyclerViewAdapter.java#L155-L164
3,317
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/TouchState.java
TouchState.getPointForID
Point getPointForID(int id) { for (int i = 0; i < pointCount; i++) { if (id == -1 || points[i].id == id) { return points[i]; } } return null; }
java
Point getPointForID(int id) { for (int i = 0; i < pointCount; i++) { if (id == -1 || points[i].id == id) { return points[i]; } } return null; }
[ "Point", "getPointForID", "(", "int", "id", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "pointCount", ";", "i", "++", ")", "{", "if", "(", "id", "==", "-", "1", "||", "points", "[", "i", "]", ".", "id", "==", "id", ")", "{", ...
Gets the Point matching the given ID. if available @param id The Point ID to match. A value of -1 matches any Point. @return a matching Point, or null if there is no point with that ID.
[ "Gets", "the", "Point", "matching", "the", "given", "ID", ".", "if", "available" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/TouchState.java#L113-L120
3,318
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/TouchState.java
TouchState.assignPrimaryID
void assignPrimaryID() { if (pointCount == 0) { primaryID = -1; } else if (primaryID <= 0) { // No primary ID is assigned. Assign a new ID arbitrarily. primaryID = points[0].id; } else { for (int i = 0; i < pointCount; i++) { if (po...
java
void assignPrimaryID() { if (pointCount == 0) { primaryID = -1; } else if (primaryID <= 0) { // No primary ID is assigned. Assign a new ID arbitrarily. primaryID = points[0].id; } else { for (int i = 0; i < pointCount; i++) { if (po...
[ "void", "assignPrimaryID", "(", ")", "{", "if", "(", "pointCount", "==", "0", ")", "{", "primaryID", "=", "-", "1", ";", "}", "else", "if", "(", "primaryID", "<=", "0", ")", "{", "// No primary ID is assigned. Assign a new ID arbitrarily.", "primaryID", "=", ...
Updates the primary point ID
[ "Updates", "the", "primary", "point", "ID" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/TouchState.java#L128-L144
3,319
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/TouchState.java
TouchState.addPoint
Point addPoint(Point p) { if (points.length == pointCount) { points = Arrays.copyOf(points, points.length * 2); } if (points[pointCount] == null) { points[pointCount] = new Point(); } if (p != null) { p.copyTo(points[pointCount]); } ...
java
Point addPoint(Point p) { if (points.length == pointCount) { points = Arrays.copyOf(points, points.length * 2); } if (points[pointCount] == null) { points[pointCount] = new Point(); } if (p != null) { p.copyTo(points[pointCount]); } ...
[ "Point", "addPoint", "(", "Point", "p", ")", "{", "if", "(", "points", ".", "length", "==", "pointCount", ")", "{", "points", "=", "Arrays", ".", "copyOf", "(", "points", ",", "points", ".", "length", "*", "2", ")", ";", "}", "if", "(", "points", ...
Adds a Point to this state object. @param p the Point describing the data to add, or null if no data is available yet for this point. p is not modified, but its contents are copied to the object describing the new Point. @return the Point with the data for the new touch point. The fields of this Point may be modified ...
[ "Adds", "a", "Point", "to", "this", "state", "object", "." ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/TouchState.java#L174-L185
3,320
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/TouchState.java
TouchState.removePointForID
void removePointForID(int id) { for (int i = 0; i < pointCount; i++) { if (points[i].id == id) { if (i < pointCount - 1) { System.arraycopy(points, i + 1, points, i, pointCount - i - 1); points[pointCount - 1] = null; } ...
java
void removePointForID(int id) { for (int i = 0; i < pointCount; i++) { if (points[i].id == id) { if (i < pointCount - 1) { System.arraycopy(points, i + 1, points, i, pointCount - i - 1); points[pointCount - 1] = null; } ...
[ "void", "removePointForID", "(", "int", "id", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "pointCount", ";", "i", "++", ")", "{", "if", "(", "points", "[", "i", "]", ".", "id", "==", "id", ")", "{", "if", "(", "i", "<", "poin...
Removes the point with the given ID @param id The ID of the touch point which is to be removed.
[ "Removes", "the", "point", "with", "the", "given", "ID" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/TouchState.java#L191-L201
3,321
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/TouchState.java
TouchState.setPoint
void setPoint(int index, Point p) { if (index >= pointCount) { throw new IndexOutOfBoundsException(); } p.copyTo(points[index]); }
java
void setPoint(int index, Point p) { if (index >= pointCount) { throw new IndexOutOfBoundsException(); } p.copyTo(points[index]); }
[ "void", "setPoint", "(", "int", "index", ",", "Point", "p", ")", "{", "if", "(", "index", ">=", "pointCount", ")", "{", "throw", "new", "IndexOutOfBoundsException", "(", ")", ";", "}", "p", ".", "copyTo", "(", "points", "[", "index", "]", ")", ";", ...
Replaces the touch point data at the given index with the given touch point data @param index the index at which to change the touch point data @param p the data to copy to the given index.
[ "Replaces", "the", "touch", "point", "data", "at", "the", "given", "index", "with", "the", "given", "touch", "point", "data" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/TouchState.java#L209-L214
3,322
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/TouchState.java
TouchState.equalsSorted
boolean equalsSorted(TouchState ts) { if (ts.pointCount == pointCount && ts.primaryID == primaryID && ts.window == window) { for (int i = 0; i < pointCount; i++) { Point p1 = ts.points[i]; Point p2 = points[i]; if (p1.x ...
java
boolean equalsSorted(TouchState ts) { if (ts.pointCount == pointCount && ts.primaryID == primaryID && ts.window == window) { for (int i = 0; i < pointCount; i++) { Point p1 = ts.points[i]; Point p2 = points[i]; if (p1.x ...
[ "boolean", "equalsSorted", "(", "TouchState", "ts", ")", "{", "if", "(", "ts", ".", "pointCount", "==", "pointCount", "&&", "ts", ".", "primaryID", "==", "primaryID", "&&", "ts", ".", "window", "==", "window", ")", "{", "for", "(", "int", "i", "=", "...
Compare two non-null states whose points are sorted by ID
[ "Compare", "two", "non", "-", "null", "states", "whose", "points", "are", "sorted", "by", "ID" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/TouchState.java#L249-L264
3,323
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/TouchState.java
TouchState.canBeFoldedWith
boolean canBeFoldedWith(TouchState ts, boolean ignoreIDs) { if (ts.pointCount != pointCount) { return false; } if (ignoreIDs) { return true; } for (int i = 0; i < pointCount; i++) { if (ts.points[i].id != points[i].id) { return ...
java
boolean canBeFoldedWith(TouchState ts, boolean ignoreIDs) { if (ts.pointCount != pointCount) { return false; } if (ignoreIDs) { return true; } for (int i = 0; i < pointCount; i++) { if (ts.points[i].id != points[i].id) { return ...
[ "boolean", "canBeFoldedWith", "(", "TouchState", "ts", ",", "boolean", "ignoreIDs", ")", "{", "if", "(", "ts", ".", "pointCount", "!=", "pointCount", ")", "{", "return", "false", ";", "}", "if", "(", "ignoreIDs", ")", "{", "return", "true", ";", "}", "...
Finds out whether two non-null states are identical in everything but their touch point coordinates @param ts the TouchState to compare to @param ignoreIDs if true, ignore IDs when comparing points
[ "Finds", "out", "whether", "two", "non", "-", "null", "states", "are", "identical", "in", "everything", "but", "their", "touch", "point", "coordinates" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/TouchState.java#L272-L285
3,324
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/LinuxTouchTransform.java
LinuxTouchTransform.getValue
int getValue(LinuxEventBuffer buffer) { int axis = buffer.getEventCode(); int value = buffer.getEventValue(); int i; for (i = 0; i < axes.length && axes[i] != -1; i++) { if (axes[i] == axis) { return transform(i, value); } } if (i =...
java
int getValue(LinuxEventBuffer buffer) { int axis = buffer.getEventCode(); int value = buffer.getEventValue(); int i; for (i = 0; i < axes.length && axes[i] != -1; i++) { if (axes[i] == axis) { return transform(i, value); } } if (i =...
[ "int", "getValue", "(", "LinuxEventBuffer", "buffer", ")", "{", "int", "axis", "=", "buffer", ".", "getEventCode", "(", ")", ";", "int", "value", "=", "buffer", ".", "getEventValue", "(", ")", ";", "int", "i", ";", "for", "(", "i", "=", "0", ";", "...
Gets the transformed pixel coordinate of the current event in the buffer provided. @param buffer A LinuxEventBuffer containing a raw event line @return a transformed value in screen space
[ "Gets", "the", "transformed", "pixel", "coordinate", "of", "the", "current", "event", "in", "the", "buffer", "provided", "." ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/LinuxTouchTransform.java#L72-L91
3,325
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/LinuxTouchTransform.java
LinuxTouchTransform.getAxis
int getAxis(LinuxEventBuffer buffer) { int axis = buffer.getEventCode(); if (flipXY) { switch (axis) { case LinuxInput.ABS_X: return LinuxInput.ABS_Y; case LinuxInput.ABS_Y: return LinuxInput.ABS_X; case LinuxInput.ABS_MT_POSITION_X: return Lin...
java
int getAxis(LinuxEventBuffer buffer) { int axis = buffer.getEventCode(); if (flipXY) { switch (axis) { case LinuxInput.ABS_X: return LinuxInput.ABS_Y; case LinuxInput.ABS_Y: return LinuxInput.ABS_X; case LinuxInput.ABS_MT_POSITION_X: return Lin...
[ "int", "getAxis", "(", "LinuxEventBuffer", "buffer", ")", "{", "int", "axis", "=", "buffer", ".", "getEventCode", "(", ")", ";", "if", "(", "flipXY", ")", "{", "switch", "(", "axis", ")", "{", "case", "LinuxInput", ".", "ABS_X", ":", "return", "LinuxIn...
Gets the transformed axis number of the current event in the buffer provided. @param buffer A LinuxEventBuffer containing a raw event line @return an axis number (e.g. Input.ABS_X)
[ "Gets", "the", "transformed", "axis", "number", "of", "the", "current", "event", "in", "the", "buffer", "provided", "." ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/LinuxTouchTransform.java#L100-L114
3,326
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/KeyState.java
KeyState.getWindow
MonocleWindow getWindow(boolean recalculateCache) { if (window == null || recalculateCache) { window = (MonocleWindow) MonocleWindowManager.getInstance().getFocusedWindow(); } return window; }
java
MonocleWindow getWindow(boolean recalculateCache) { if (window == null || recalculateCache) { window = (MonocleWindow) MonocleWindowManager.getInstance().getFocusedWindow(); } return window; }
[ "MonocleWindow", "getWindow", "(", "boolean", "recalculateCache", ")", "{", "if", "(", "window", "==", "null", "||", "recalculateCache", ")", "{", "window", "=", "(", "MonocleWindow", ")", "MonocleWindowManager", ".", "getInstance", "(", ")", ".", "getFocusedWin...
Returns the Glass window on which this event state is located .
[ "Returns", "the", "Glass", "window", "on", "which", "this", "event", "state", "is", "located", "." ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/KeyState.java#L78-L84
3,327
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/MonocleDnDClipboard.java
MonocleDnDClipboard.pushToSystem
@Override protected void pushToSystem(HashMap<String, Object> cacheData, int supportedActions) { MouseInput.getInstance().notifyDragStart(); ((MonocleApplication) Application.GetApplication()).enterDnDEventLoop(); actionPerformed(Clipboard.ACTION_COPY_OR_MOVE); }
java
@Override protected void pushToSystem(HashMap<String, Object> cacheData, int supportedActions) { MouseInput.getInstance().notifyDragStart(); ((MonocleApplication) Application.GetApplication()).enterDnDEventLoop(); actionPerformed(Clipboard.ACTION_COPY_OR_MOVE); }
[ "@", "Override", "protected", "void", "pushToSystem", "(", "HashMap", "<", "String", ",", "Object", ">", "cacheData", ",", "int", "supportedActions", ")", "{", "MouseInput", ".", "getInstance", "(", ")", ".", "notifyDragStart", "(", ")", ";", "(", "(", "Mo...
Here the magic happens. When this method is called all input events should be grabbed and appropriate drag notifications should be sent instead of regular input events
[ "Here", "the", "magic", "happens", ".", "When", "this", "method", "is", "called", "all", "input", "events", "should", "be", "grabbed", "and", "appropriate", "drag", "notifications", "should", "be", "sent", "instead", "of", "regular", "input", "events" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/MonocleDnDClipboard.java#L51-L56
3,328
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/TouchPipeline.java
TouchPipeline.add
void add(TouchPipeline pipeline) { for (int i = 0; i < pipeline.filters.size(); i++) { addFilter(pipeline.filters.get(i)); } }
java
void add(TouchPipeline pipeline) { for (int i = 0; i < pipeline.filters.size(); i++) { addFilter(pipeline.filters.get(i)); } }
[ "void", "add", "(", "TouchPipeline", "pipeline", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "pipeline", ".", "filters", ".", "size", "(", ")", ";", "i", "++", ")", "{", "addFilter", "(", "pipeline", ".", "filters", ".", "get", "("...
Adds the filters in the given pipeline to this pipeline
[ "Adds", "the", "filters", "in", "the", "given", "pipeline", "to", "this", "pipeline" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/TouchPipeline.java#L39-L43
3,329
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/TouchPipeline.java
TouchPipeline.addNamedFilters
void addNamedFilters(String filterNameList) { String[] touchFilterNames = filterNameList.split(","); if (touchFilterNames != null) { for (String touchFilterName : touchFilterNames) { String s = touchFilterName.trim(); if (s.length() > 0) { ...
java
void addNamedFilters(String filterNameList) { String[] touchFilterNames = filterNameList.split(","); if (touchFilterNames != null) { for (String touchFilterName : touchFilterNames) { String s = touchFilterName.trim(); if (s.length() > 0) { ...
[ "void", "addNamedFilters", "(", "String", "filterNameList", ")", "{", "String", "[", "]", "touchFilterNames", "=", "filterNameList", ".", "split", "(", "\",\"", ")", ";", "if", "(", "touchFilterNames", "!=", "null", ")", "{", "for", "(", "String", "touchFilt...
Attempts to add the filters named in the comma-separated list provided.
[ "Attempts", "to", "add", "the", "filters", "named", "in", "the", "comma", "-", "separated", "list", "provided", "." ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/TouchPipeline.java#L48-L58
3,330
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/TouchPipeline.java
TouchPipeline.flush
void flush() { for (int i = 0; i < filters.size(); i++) { TouchFilter filter = filters.get(i); while (filter.flush(flushState)) { if (MonocleSettings.settings.traceEventsVerbose) { MonocleTrace.traceEvent("Flushing %s from %s", flushState, filter); ...
java
void flush() { for (int i = 0; i < filters.size(); i++) { TouchFilter filter = filters.get(i); while (filter.flush(flushState)) { if (MonocleSettings.settings.traceEventsVerbose) { MonocleTrace.traceEvent("Flushing %s from %s", flushState, filter); ...
[ "void", "flush", "(", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "filters", ".", "size", "(", ")", ";", "i", "++", ")", "{", "TouchFilter", "filter", "=", "filters", ".", "get", "(", "i", ")", ";", "while", "(", "filter", ".",...
Flushes any remaining data in the pipeline, possibly pushing more state objects to TouchInput.
[ "Flushes", "any", "remaining", "data", "in", "the", "pipeline", "possibly", "pushing", "more", "state", "objects", "to", "TouchInput", "." ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/TouchPipeline.java#L124-L140
3,331
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/NativePlatformFactory.java
NativePlatformFactory.getNativePlatform
public static synchronized NativePlatform getNativePlatform() { if (platform == null) { String platformFactoryProperty = AccessController.doPrivileged((PrivilegedAction<String>) () -> System.getProperty("monocle.platform", "MX6,OMAP,D...
java
public static synchronized NativePlatform getNativePlatform() { if (platform == null) { String platformFactoryProperty = AccessController.doPrivileged((PrivilegedAction<String>) () -> System.getProperty("monocle.platform", "MX6,OMAP,D...
[ "public", "static", "synchronized", "NativePlatform", "getNativePlatform", "(", ")", "{", "if", "(", "platform", "==", "null", ")", "{", "String", "platformFactoryProperty", "=", "AccessController", ".", "doPrivileged", "(", "(", "PrivilegedAction", "<", "String", ...
Obtains a NativePlatform that matches the platform on which we are running. The system property monocle.platform defines a series of cascading fallbacks for what NativePlatform types to attempt to create. monocle .platform can be overridden to select a specific platform. For example, running with -Dmonocle.platform=Di...
[ "Obtains", "a", "NativePlatform", "that", "matches", "the", "platform", "on", "which", "we", "are", "running", "." ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/NativePlatformFactory.java#L82-L131
3,332
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/Udev.java
Udev.getInstance
static synchronized Udev getInstance() { if (instance == null) { try { instance = new Udev(); } catch (IOException e) { System.err.println("Udev: failed to open connection"); e.printStackTrace(); } } return insta...
java
static synchronized Udev getInstance() { if (instance == null) { try { instance = new Udev(); } catch (IOException e) { System.err.println("Udev: failed to open connection"); e.printStackTrace(); } } return insta...
[ "static", "synchronized", "Udev", "getInstance", "(", ")", "{", "if", "(", "instance", "==", "null", ")", "{", "try", "{", "instance", "=", "new", "Udev", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "System", ".", "err", ".", "p...
Gets the singleton Udev object
[ "Gets", "the", "singleton", "Udev", "object" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/Udev.java#L48-L58
3,333
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/Udev.java
Udev.readEvent
private Map<String, String> readEvent() throws IOException { Map<String, String> map = new HashMap<>(); ByteBuffer b; synchronized (this) { b = buffer; if (b == null) { return map; } } int length = _readEvent(fd, b); syn...
java
private Map<String, String> readEvent() throws IOException { Map<String, String> map = new HashMap<>(); ByteBuffer b; synchronized (this) { b = buffer; if (b == null) { return map; } } int length = _readEvent(fd, b); syn...
[ "private", "Map", "<", "String", ",", "String", ">", "readEvent", "(", ")", "throws", "IOException", "{", "Map", "<", "String", ",", "String", ">", "map", "=", "new", "HashMap", "<>", "(", ")", ";", "ByteBuffer", "b", ";", "synchronized", "(", "this", ...
Reads data from the udev monitor. Blocks until data is available
[ "Reads", "data", "from", "the", "udev", "monitor", ".", "Blocks", "until", "data", "is", "available" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/Udev.java#L136-L194
3,334
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/Udev.java
Udev.close
synchronized void close() { thread.interrupt(); _close(fd); fd = 0l; buffer = null; thread = null; }
java
synchronized void close() { thread.interrupt(); _close(fd); fd = 0l; buffer = null; thread = null; }
[ "synchronized", "void", "close", "(", ")", "{", "thread", ".", "interrupt", "(", ")", ";", "_close", "(", "fd", ")", ";", "fd", "=", "0l", ";", "buffer", "=", "null", ";", "thread", "=", "null", ";", "}" ]
Closes the udev monitor connection
[ "Closes", "the", "udev", "monitor", "connection" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/Udev.java#L197-L203
3,335
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/LinuxEventBuffer.java
LinuxEventBuffer.put
synchronized boolean put(ByteBuffer event) throws InterruptedException { boolean isSync = event.getInt(eventStruct.getTypeIndex()) == 0 && event.getInt(eventStruct.getValueIndex()) == 0; while (bb.limit() - bb.position() < event.limit()) { // Block if bb is full. ...
java
synchronized boolean put(ByteBuffer event) throws InterruptedException { boolean isSync = event.getInt(eventStruct.getTypeIndex()) == 0 && event.getInt(eventStruct.getValueIndex()) == 0; while (bb.limit() - bb.position() < event.limit()) { // Block if bb is full. ...
[ "synchronized", "boolean", "put", "(", "ByteBuffer", "event", ")", "throws", "InterruptedException", "{", "boolean", "isSync", "=", "event", ".", "getInt", "(", "eventStruct", ".", "getTypeIndex", "(", ")", ")", "==", "0", "&&", "event", ".", "getInt", "(", ...
Adds a raw Linux event to the buffer. Blocks if the buffer is full. Checks whether this is a SYN SYN_REPORT event terminator. @param event A ByteBuffer containing the event to be added. @return true if the event was "SYN SYN_REPORT", false otherwise @throws InterruptedException if our thread was interrupted while wait...
[ "Adds", "a", "raw", "Linux", "event", "to", "the", "buffer", ".", "Blocks", "if", "the", "buffer", "is", "full", ".", "Checks", "whether", "this", "is", "a", "SYN", "SYN_REPORT", "event", "terminator", "." ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/LinuxEventBuffer.java#L91-L117
3,336
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/LinuxEventBuffer.java
LinuxEventBuffer.nextEvent
synchronized void nextEvent() { if (currentPosition > positionOfLastSync) { throw new IllegalStateException("Cannot advance past the last" + " EV_SYN EV_SYN_REPORT 0"); } currentPosition += eventStruct.getSize(); if (Monocle...
java
synchronized void nextEvent() { if (currentPosition > positionOfLastSync) { throw new IllegalStateException("Cannot advance past the last" + " EV_SYN EV_SYN_REPORT 0"); } currentPosition += eventStruct.getSize(); if (Monocle...
[ "synchronized", "void", "nextEvent", "(", ")", "{", "if", "(", "currentPosition", ">", "positionOfLastSync", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Cannot advance past the last\"", "+", "\" EV_SYN EV_SYN_REPORT 0\"", ")", ";", "}", "currentPosition",...
Advances to the next event line. Call from the application thread.
[ "Advances", "to", "the", "next", "event", "line", ".", "Call", "from", "the", "application", "thread", "." ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/LinuxEventBuffer.java#L191-L201
3,337
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/LinuxInput.java
LinuxInput.typeToString
static String typeToString(short type) { for (Field field : LinuxInput.class.getDeclaredFields()) { try { if (field.getName().startsWith("EV_") && field.getType() == Short.TYPE && field.getShort(null) == type) { retu...
java
static String typeToString(short type) { for (Field field : LinuxInput.class.getDeclaredFields()) { try { if (field.getName().startsWith("EV_") && field.getType() == Short.TYPE && field.getShort(null) == type) { retu...
[ "static", "String", "typeToString", "(", "short", "type", ")", "{", "for", "(", "Field", "field", ":", "LinuxInput", ".", "class", ".", "getDeclaredFields", "(", ")", ")", "{", "try", "{", "if", "(", "field", ".", "getName", "(", ")", ".", "startsWith"...
Convert an event type to its equivalent string. This method is inefficient and is for debugging use only.
[ "Convert", "an", "event", "type", "to", "its", "equivalent", "string", ".", "This", "method", "is", "inefficient", "and", "is", "for", "debugging", "use", "only", "." ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/LinuxInput.java#L738-L750
3,338
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/LinuxInput.java
LinuxInput.codeToString
static String codeToString(String type, short code) { int i = type.indexOf("_"); if (i >= 0) { String prefix = type.substring(i + 1); String altPrefix = prefix.equals("KEY") ? "BTN" : prefix; for (Field field : LinuxInput.class.getDeclaredFields()) { S...
java
static String codeToString(String type, short code) { int i = type.indexOf("_"); if (i >= 0) { String prefix = type.substring(i + 1); String altPrefix = prefix.equals("KEY") ? "BTN" : prefix; for (Field field : LinuxInput.class.getDeclaredFields()) { S...
[ "static", "String", "codeToString", "(", "String", "type", ",", "short", "code", ")", "{", "int", "i", "=", "type", ".", "indexOf", "(", "\"_\"", ")", ";", "if", "(", "i", ">=", "0", ")", "{", "String", "prefix", "=", "type", ".", "substring", "(",...
Convert an event code to its equivalent string, given its type string. The type string is needed because event codes are context sensitive. For example, the code 1 is "SYN_CONFIG" for an EV_SYN event but "KEY_ESC" for an EV_KEY event. This method is inefficient and is for debugging use only.
[ "Convert", "an", "event", "code", "to", "its", "equivalent", "string", "given", "its", "type", "string", ".", "The", "type", "string", "is", "needed", "because", "event", "codes", "are", "context", "sensitive", ".", "For", "example", "the", "code", "1", "i...
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/LinuxInput.java#L759-L777
3,339
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/LinuxAbsoluteInputCapabilities.java
LinuxAbsoluteInputCapabilities.getCapabilities
static Map<Integer, LinuxAbsoluteInputCapabilities> getCapabilities( File devNode, BitSet axes) throws IOException { if (axes == null || axes.isEmpty()) { return null; } LinuxSystem system = LinuxSystem.getLinuxSystem(); LinuxSystem.InputAbsInfo info = new LinuxSy...
java
static Map<Integer, LinuxAbsoluteInputCapabilities> getCapabilities( File devNode, BitSet axes) throws IOException { if (axes == null || axes.isEmpty()) { return null; } LinuxSystem system = LinuxSystem.getLinuxSystem(); LinuxSystem.InputAbsInfo info = new LinuxSy...
[ "static", "Map", "<", "Integer", ",", "LinuxAbsoluteInputCapabilities", ">", "getCapabilities", "(", "File", "devNode", ",", "BitSet", "axes", ")", "throws", "IOException", "{", "if", "(", "axes", "==", "null", "||", "axes", ".", "isEmpty", "(", ")", ")", ...
Reads capabilities from a device node. @return A Map of capabilities for each supported axis, or null if no capabilities are available. @throws IOException if an error occured when reading capabilities
[ "Reads", "capabilities", "from", "a", "device", "node", "." ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/LinuxAbsoluteInputCapabilities.java#L73-L91
3,340
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/AssignPointIDTouchFilter.java
AssignPointIDTouchFilter.releaseID
private void releaseID(int id) { ids.removeInt(id); nextID = 1; for (int i = 0; i < ids.size(); i++) { nextID = Math.max(ids.get(i) + 1, nextID); } }
java
private void releaseID(int id) { ids.removeInt(id); nextID = 1; for (int i = 0; i < ids.size(); i++) { nextID = Math.max(ids.get(i) + 1, nextID); } }
[ "private", "void", "releaseID", "(", "int", "id", ")", "{", "ids", ".", "removeInt", "(", "id", ")", ";", "nextID", "=", "1", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "ids", ".", "size", "(", ")", ";", "i", "++", ")", "{", "nex...
Release a touch point ID
[ "Release", "a", "touch", "point", "ID" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/AssignPointIDTouchFilter.java#L48-L54
3,341
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/RunnableProcessor.java
RunnableProcessor.invokeAndWait
void invokeAndWait(final Runnable r) { final CountDownLatch latch = new CountDownLatch(1); queue.postRunnable(() -> { try { r.run(); } finally { latch.countDown(); } }); try { latch.await(); } catch (...
java
void invokeAndWait(final Runnable r) { final CountDownLatch latch = new CountDownLatch(1); queue.postRunnable(() -> { try { r.run(); } finally { latch.countDown(); } }); try { latch.await(); } catch (...
[ "void", "invokeAndWait", "(", "final", "Runnable", "r", ")", "{", "final", "CountDownLatch", "latch", "=", "new", "CountDownLatch", "(", "1", ")", ";", "queue", ".", "postRunnable", "(", "(", ")", "->", "{", "try", "{", "r", ".", "run", "(", ")", ";"...
Posts a Runnable to the JavaFX event queue and waits for the Runnable to complete. @param r an action to be performed on the JavaFX application thread.
[ "Posts", "a", "Runnable", "to", "the", "JavaFX", "event", "queue", "and", "waits", "for", "the", "Runnable", "to", "complete", "." ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/RunnableProcessor.java#L69-L81
3,342
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/EGL.java
EGL.eglErrorToString
String eglErrorToString(int errorCode) { if (errorCode >= 0x3000 && errorCode < 0x3020) { for (Field field : EGL.class.getFields()) { try { if (field.getName().startsWith("EGL_") && field.getType() == Integer.TYPE ...
java
String eglErrorToString(int errorCode) { if (errorCode >= 0x3000 && errorCode < 0x3020) { for (Field field : EGL.class.getFields()) { try { if (field.getName().startsWith("EGL_") && field.getType() == Integer.TYPE ...
[ "String", "eglErrorToString", "(", "int", "errorCode", ")", "{", "if", "(", "errorCode", ">=", "0x3000", "&&", "errorCode", "<", "0x3020", ")", "{", "for", "(", "Field", "field", ":", "EGL", ".", "class", ".", "getFields", "(", ")", ")", "{", "try", ...
Convert an EGL error code such as EGL_BAD_CONTEXT to a string representation. @param errorCode the EGL error code @return the constant name of the error code. If errorCode cannot be matched to an EGL error, a string representation of the error code's value is returned.
[ "Convert", "an", "EGL", "error", "code", "such", "as", "EGL_BAD_CONTEXT", "to", "a", "string", "representation", "." ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/EGL.java#L245-L262
3,343
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/TouchInput.java
TouchInput.getBasePipeline
TouchPipeline getBasePipeline() { if (basePipeline == null) { basePipeline = new TouchPipeline(); String[] touchFilterNames = AccessController.doPrivileged( (PrivilegedAction<String>) () -> System.getProperty( "monocle.input.touchFilters", ...
java
TouchPipeline getBasePipeline() { if (basePipeline == null) { basePipeline = new TouchPipeline(); String[] touchFilterNames = AccessController.doPrivileged( (PrivilegedAction<String>) () -> System.getProperty( "monocle.input.touchFilters", ...
[ "TouchPipeline", "getBasePipeline", "(", ")", "{", "if", "(", "basePipeline", "==", "null", ")", "{", "basePipeline", "=", "new", "TouchPipeline", "(", ")", ";", "String", "[", "]", "touchFilterNames", "=", "AccessController", ".", "doPrivileged", "(", "(", ...
Gets the base touch filter pipeline common to all touch devices
[ "Gets", "the", "base", "touch", "filter", "pipeline", "common", "to", "all", "touch", "devices" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/TouchInput.java#L70-L85
3,344
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/TouchInput.java
TouchInput.setState
void setState(TouchState newState) { if (MonocleSettings.settings.traceEvents) { MonocleTrace.traceEvent("Set %s", newState); } newState.sortPointsByID(); newState.assignPrimaryID(); // Get the cached window for the old state and compute the window for // the ...
java
void setState(TouchState newState) { if (MonocleSettings.settings.traceEvents) { MonocleTrace.traceEvent("Set %s", newState); } newState.sortPointsByID(); newState.assignPrimaryID(); // Get the cached window for the old state and compute the window for // the ...
[ "void", "setState", "(", "TouchState", "newState", ")", "{", "if", "(", "MonocleSettings", ".", "settings", ".", "traceEvents", ")", "{", "MonocleTrace", ".", "traceEvent", "(", "\"Set %s\"", ",", "newState", ")", ";", "}", "newState", ".", "sortPointsByID", ...
Called from the input processor to update the touch state and send touch and mouse events. @param newState The updated touch state
[ "Called", "from", "the", "input", "processor", "to", "update", "the", "touch", "state", "and", "send", "touch", "and", "mouse", "events", "." ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/TouchInput.java#L100-L127
3,345
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/TouchInput.java
TouchInput.postTouchEvent
private void postTouchEvent(TouchState state, int eventType) { Window window = state.getWindow(false, null); View view = window == null ? null : window.getView(); if (view != null) { switch (state.getPointCount()) { case 0: postNoPoints(view); ...
java
private void postTouchEvent(TouchState state, int eventType) { Window window = state.getWindow(false, null); View view = window == null ? null : window.getView(); if (view != null) { switch (state.getPointCount()) { case 0: postNoPoints(view); ...
[ "private", "void", "postTouchEvent", "(", "TouchState", "state", ",", "int", "eventType", ")", "{", "Window", "window", "=", "state", ".", "getWindow", "(", "false", ",", "null", ")", ";", "View", "view", "=", "window", "==", "null", "?", "null", ":", ...
Sends the same event type for all points in the given state @param state The state for which to process all points @param eventType The type of TouchEvent to send (e.g. TouchEvent.PRESSED)
[ "Sends", "the", "same", "event", "type", "for", "all", "points", "in", "the", "given", "state" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/TouchInput.java#L172-L200
3,346
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/TouchInput.java
TouchInput.postTouchEvent
private void postTouchEvent(MonocleWindow window, View view, TouchState newState) { int count = countEvents(newState); switch (count) { case 0: postNoPoints(view); break; case 1: ...
java
private void postTouchEvent(MonocleWindow window, View view, TouchState newState) { int count = countEvents(newState); switch (count) { case 0: postNoPoints(view); break; case 1: ...
[ "private", "void", "postTouchEvent", "(", "MonocleWindow", "window", ",", "View", "view", ",", "TouchState", "newState", ")", "{", "int", "count", "=", "countEvents", "(", "newState", ")", ";", "switch", "(", "count", ")", "{", "case", "0", ":", "postNoPoi...
Sends updated touch points within the same View as last processed touch points. @param window The current Window @param view The current View @param newState The updated touch points
[ "Sends", "updated", "touch", "points", "within", "the", "same", "View", "as", "last", "processed", "touch", "points", "." ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/TouchInput.java#L209-L282
3,347
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/MonocleWindow.java
MonocleWindow._createWindow
@Override protected long _createWindow(long NativeWindow, long NativeScreen, int mask) { id = MonocleWindowManager.getInstance().addWindow(this); return id; }
java
@Override protected long _createWindow(long NativeWindow, long NativeScreen, int mask) { id = MonocleWindowManager.getInstance().addWindow(this); return id; }
[ "@", "Override", "protected", "long", "_createWindow", "(", "long", "NativeWindow", ",", "long", "NativeScreen", ",", "int", "mask", ")", "{", "id", "=", "MonocleWindowManager", ".", "getInstance", "(", ")", ".", "addWindow", "(", "this", ")", ";", "return",...
creates the native window
[ "creates", "the", "native", "window" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/MonocleWindow.java#L163-L168
3,348
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/NativePlatform.java
NativePlatform.shutdown
void shutdown() { runnableProcessor.shutdown(); if (cursor != null) { cursor.shutdown(); } if (screen != null) { screen.shutdown(); } }
java
void shutdown() { runnableProcessor.shutdown(); if (cursor != null) { cursor.shutdown(); } if (screen != null) { screen.shutdown(); } }
[ "void", "shutdown", "(", ")", "{", "runnableProcessor", ".", "shutdown", "(", ")", ";", "if", "(", "cursor", "!=", "null", ")", "{", "cursor", ".", "shutdown", "(", ")", ";", "}", "if", "(", "screen", "!=", "null", ")", "{", "screen", ".", "shutdow...
Called once during JavaFX shutdown to release platform resources.
[ "Called", "once", "during", "JavaFX", "shutdown", "to", "release", "platform", "resources", "." ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/NativePlatform.java#L44-L52
3,349
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/NativePlatform.java
NativePlatform.getAcceleratedScreen
public synchronized AcceleratedScreen getAcceleratedScreen(int[] attributes) throws GLException, UnsatisfiedLinkError { if (accScreen == null) { accScreen = new AcceleratedScreen(attributes); } return accScreen; }
java
public synchronized AcceleratedScreen getAcceleratedScreen(int[] attributes) throws GLException, UnsatisfiedLinkError { if (accScreen == null) { accScreen = new AcceleratedScreen(attributes); } return accScreen; }
[ "public", "synchronized", "AcceleratedScreen", "getAcceleratedScreen", "(", "int", "[", "]", "attributes", ")", "throws", "GLException", ",", "UnsatisfiedLinkError", "{", "if", "(", "accScreen", "==", "null", ")", "{", "accScreen", "=", "new", "AcceleratedScreen", ...
Gets the AcceleratedScreen for this platform @param attributes a sequence of pairs (GLAttibute, value) @return an AcceleratedScreen for rendering using OpenGL @throws GLException if no OpenGL surface could be created @throws UnsatisfiedLinkError if native graphics libraries could not be loaded for this platform.
[ "Gets", "the", "AcceleratedScreen", "for", "this", "platform" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/NativePlatform.java#L124-L130
3,350
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/AndroidPlatform.java
AndroidPlatform.getAcceleratedScreen
@Override public synchronized AcceleratedScreen getAcceleratedScreen( int[] attributes) throws GLException { if (accScreen == null) { accScreen = new AndroidAcceleratedScreen(attributes); } return accScreen; }
java
@Override public synchronized AcceleratedScreen getAcceleratedScreen( int[] attributes) throws GLException { if (accScreen == null) { accScreen = new AndroidAcceleratedScreen(attributes); } return accScreen; }
[ "@", "Override", "public", "synchronized", "AcceleratedScreen", "getAcceleratedScreen", "(", "int", "[", "]", "attributes", ")", "throws", "GLException", "{", "if", "(", "accScreen", "==", "null", ")", "{", "accScreen", "=", "new", "AndroidAcceleratedScreen", "(",...
Create the accelerated screen for this platform @param attributes a sequence of pairs (GLAttibute, value) @throws GLException
[ "Create", "the", "accelerated", "screen", "for", "this", "platform" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/AndroidPlatform.java#L55-L62
3,351
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/SysFS.java
SysFS.readCapabilities
static Map<String, BitSet> readCapabilities(File sysPath) { Map<String, BitSet> capsMap = new HashMap<String, BitSet>(); File[] capsFiles = new File(sysPath, "device/capabilities").listFiles(); if (capsFiles == null) { return capsMap; } for (int i = 0; i < capsFiles.l...
java
static Map<String, BitSet> readCapabilities(File sysPath) { Map<String, BitSet> capsMap = new HashMap<String, BitSet>(); File[] capsFiles = new File(sysPath, "device/capabilities").listFiles(); if (capsFiles == null) { return capsMap; } for (int i = 0; i < capsFiles.l...
[ "static", "Map", "<", "String", ",", "BitSet", ">", "readCapabilities", "(", "File", "sysPath", ")", "{", "Map", "<", "String", ",", "BitSet", ">", "capsMap", "=", "new", "HashMap", "<", "String", ",", "BitSet", ">", "(", ")", ";", "File", "[", "]", ...
Read input device capability data from sysfs
[ "Read", "input", "device", "capability", "data", "from", "sysfs" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/SysFS.java#L47-L81
3,352
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/SysFS.java
SysFS.triggerUdevNotification
static void triggerUdevNotification(String sysClass) { File[] devices = new File("/sys/class/" + sysClass).listFiles(); byte[] action = "change".getBytes(); for (File device: devices) { File uevent = new File(device, "uevent"); if (uevent.exists()) { try {...
java
static void triggerUdevNotification(String sysClass) { File[] devices = new File("/sys/class/" + sysClass).listFiles(); byte[] action = "change".getBytes(); for (File device: devices) { File uevent = new File(device, "uevent"); if (uevent.exists()) { try {...
[ "static", "void", "triggerUdevNotification", "(", "String", "sysClass", ")", "{", "File", "[", "]", "devices", "=", "new", "File", "(", "\"/sys/class/\"", "+", "sysClass", ")", ".", "listFiles", "(", ")", ";", "byte", "[", "]", "action", "=", "\"change\"",...
Fires udev notification events for devices of the given type
[ "Fires", "udev", "notification", "events", "for", "devices", "of", "the", "given", "type" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/SysFS.java#L101-L118
3,353
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/SysFS.java
SysFS.readInts
static int[] readInts(String location, int expectedLength) throws IOException { BufferedReader r = new BufferedReader(new FileReader(location)); String s = r.readLine(); r.close(); if (s != null && s.length() > 0) { String[] elements = s.split(","); try { ...
java
static int[] readInts(String location, int expectedLength) throws IOException { BufferedReader r = new BufferedReader(new FileReader(location)); String s = r.readLine(); r.close(); if (s != null && s.length() > 0) { String[] elements = s.split(","); try { ...
[ "static", "int", "[", "]", "readInts", "(", "String", "location", ",", "int", "expectedLength", ")", "throws", "IOException", "{", "BufferedReader", "r", "=", "new", "BufferedReader", "(", "new", "FileReader", "(", "location", ")", ")", ";", "String", "s", ...
Read a comma-separated list of integer values from a file
[ "Read", "a", "comma", "-", "separated", "list", "of", "integer", "values", "from", "a", "file" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/SysFS.java#L134-L159
3,354
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/SysFS.java
SysFS.readInt
static int readInt(String location) throws IOException { BufferedReader r = new BufferedReader(new FileReader(location)); String s = r.readLine(); r.close(); try { if (s != null && s.length() > 0) { return Integer.parseInt(s); } else { ...
java
static int readInt(String location) throws IOException { BufferedReader r = new BufferedReader(new FileReader(location)); String s = r.readLine(); r.close(); try { if (s != null && s.length() > 0) { return Integer.parseInt(s); } else { ...
[ "static", "int", "readInt", "(", "String", "location", ")", "throws", "IOException", "{", "BufferedReader", "r", "=", "new", "BufferedReader", "(", "new", "FileReader", "(", "location", ")", ")", ";", "String", "s", "=", "r", ".", "readLine", "(", ")", "...
Read a single integer value from a file
[ "Read", "a", "single", "integer", "value", "from", "a", "file" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/SysFS.java#L164-L178
3,355
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/AcceleratedScreen.java
AcceleratedScreen.enableRendering
public void enableRendering(boolean flag) { if (flag) { egl.eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext); } else { egl.eglMakeCurrent(eglDisplay, 0, 0, eglContext); } }
java
public void enableRendering(boolean flag) { if (flag) { egl.eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext); } else { egl.eglMakeCurrent(eglDisplay, 0, 0, eglContext); } }
[ "public", "void", "enableRendering", "(", "boolean", "flag", ")", "{", "if", "(", "flag", ")", "{", "egl", ".", "eglMakeCurrent", "(", "eglDisplay", ",", "eglSurface", ",", "eglSurface", ",", "eglContext", ")", ";", "}", "else", "{", "egl", ".", "eglMake...
Make the EGL drawing surface current or not @param flag
[ "Make", "the", "EGL", "drawing", "surface", "current", "or", "not" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/AcceleratedScreen.java#L134-L141
3,356
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/AcceleratedScreen.java
AcceleratedScreen.initPlatformLibraries
boolean initPlatformLibraries() throws UnsatisfiedLinkError{ if (!initialized) { glesLibraryHandle = ls.dlopen("libGLESv2.so", LinuxSystem.RTLD_LAZY | LinuxSystem.RTLD_GLOBAL); if (glesLibraryHandle == 0l) { throw new UnsatisfiedLinkError("Error loadin...
java
boolean initPlatformLibraries() throws UnsatisfiedLinkError{ if (!initialized) { glesLibraryHandle = ls.dlopen("libGLESv2.so", LinuxSystem.RTLD_LAZY | LinuxSystem.RTLD_GLOBAL); if (glesLibraryHandle == 0l) { throw new UnsatisfiedLinkError("Error loadin...
[ "boolean", "initPlatformLibraries", "(", ")", "throws", "UnsatisfiedLinkError", "{", "if", "(", "!", "initialized", ")", "{", "glesLibraryHandle", "=", "ls", ".", "dlopen", "(", "\"libGLESv2.so\"", ",", "LinuxSystem", ".", "RTLD_LAZY", "|", "LinuxSystem", ".", "...
Load any native libraries needed to instantiate and initialize the native drawing surface and rendering context @return success or failure @throws UnsatisfiedLinkError
[ "Load", "any", "native", "libraries", "needed", "to", "instantiate", "and", "initialize", "the", "native", "drawing", "surface", "and", "rendering", "context" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/AcceleratedScreen.java#L148-L163
3,357
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/AcceleratedScreen.java
AcceleratedScreen.swapBuffers
public boolean swapBuffers() { boolean result = false; synchronized(NativeScreen.framebufferSwapLock) { result = egl.eglSwapBuffers(eglDisplay, eglSurface); // TODO this shouldn't happen. In case the surface is invalid, we need to have recreated it before this method is called if...
java
public boolean swapBuffers() { boolean result = false; synchronized(NativeScreen.framebufferSwapLock) { result = egl.eglSwapBuffers(eglDisplay, eglSurface); // TODO this shouldn't happen. In case the surface is invalid, we need to have recreated it before this method is called if...
[ "public", "boolean", "swapBuffers", "(", ")", "{", "boolean", "result", "=", "false", ";", "synchronized", "(", "NativeScreen", ".", "framebufferSwapLock", ")", "{", "result", "=", "egl", ".", "eglSwapBuffers", "(", "eglDisplay", ",", "eglSurface", ")", ";", ...
Copy the contents of the GL backbuffer to the screen @return success or failure
[ "Copy", "the", "contents", "of", "the", "GL", "backbuffer", "to", "the", "screen" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/AcceleratedScreen.java#L181-L193
3,358
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/X11InputDeviceRegistry.java
X11InputDeviceRegistry.processXEvent
private void processXEvent(X.XEvent event, RunnableProcessor runnableProcessor) { switch (X.XEvent.getType(event.p)) { case X.ButtonPress: { X.XButtonEvent buttonEvent = new X.XButtonEvent(event); int button = X.XButtonEvent.getButton(bu...
java
private void processXEvent(X.XEvent event, RunnableProcessor runnableProcessor) { switch (X.XEvent.getType(event.p)) { case X.ButtonPress: { X.XButtonEvent buttonEvent = new X.XButtonEvent(event); int button = X.XButtonEvent.getButton(bu...
[ "private", "void", "processXEvent", "(", "X", ".", "XEvent", "event", ",", "RunnableProcessor", "runnableProcessor", ")", "{", "switch", "(", "X", ".", "XEvent", ".", "getType", "(", "event", ".", "p", ")", ")", "{", "case", "X", ".", "ButtonPress", ":",...
Dispatch the X Event to the appropriate processor. All processors run via invokeLater @param event @param runnableProcessor
[ "Dispatch", "the", "X", "Event", "to", "the", "appropriate", "processor", ".", "All", "processors", "run", "via", "invokeLater" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/X11InputDeviceRegistry.java#L98-L122
3,359
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/X11InputDeviceRegistry.java
X11InputDeviceRegistry.buttonToGlassButton
private static int buttonToGlassButton(int button) { switch (button) { case X.Button1: return MouseEvent.BUTTON_LEFT; case X.Button2: return MouseEvent.BUTTON_OTHER; case X.Button3: return MouseEvent.BUTTON_RIGHT; default: return MouseEvent.BUTTON_NONE; } ...
java
private static int buttonToGlassButton(int button) { switch (button) { case X.Button1: return MouseEvent.BUTTON_LEFT; case X.Button2: return MouseEvent.BUTTON_OTHER; case X.Button3: return MouseEvent.BUTTON_RIGHT; default: return MouseEvent.BUTTON_NONE; } ...
[ "private", "static", "int", "buttonToGlassButton", "(", "int", "button", ")", "{", "switch", "(", "button", ")", "{", "case", "X", ".", "Button1", ":", "return", "MouseEvent", ".", "BUTTON_LEFT", ";", "case", "X", ".", "Button2", ":", "return", "MouseEvent...
Convenience method to convert X11 button codes to glass button codes @param button
[ "Convenience", "method", "to", "convert", "X11", "button", "codes", "to", "glass", "button", "codes" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/X11InputDeviceRegistry.java#L176-L183
3,360
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/MouseState.java
MouseState.getWindow
MonocleWindow getWindow(boolean recalculateCache) { if (window == null || recalculateCache) { window = (MonocleWindow) MonocleWindowManager.getInstance().getWindowForLocation(x, y); } return window; }
java
MonocleWindow getWindow(boolean recalculateCache) { if (window == null || recalculateCache) { window = (MonocleWindow) MonocleWindowManager.getInstance().getWindowForLocation(x, y); } return window; }
[ "MonocleWindow", "getWindow", "(", "boolean", "recalculateCache", ")", "{", "if", "(", "window", "==", "null", "||", "recalculateCache", ")", "{", "window", "=", "(", "MonocleWindow", ")", "MonocleWindowManager", ".", "getInstance", "(", ")", ".", "getWindowForL...
Returns the Glass window on which the coordinates of this state are located. @param recalculateCache true if the cached value for the target window should be recalculated; false if the cached value should be used to determine the result of this method. @return the MonocleWindow at the top of the stack at the coordinate...
[ "Returns", "the", "Glass", "window", "on", "which", "the", "coordinates", "of", "this", "state", "are", "located", "." ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/MouseState.java#L89-L95
3,361
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/MouseState.java
MouseState.getModifiers
int getModifiers() { int modifiers = KeyEvent.MODIFIER_NONE; for (int i = 0; i < buttonsPressed.size(); i++) { switch(buttonsPressed.get(i)) { case MouseEvent.BUTTON_LEFT: modifiers |= KeyEvent.MODIFIER_BUTTON_PRIMARY; break; ...
java
int getModifiers() { int modifiers = KeyEvent.MODIFIER_NONE; for (int i = 0; i < buttonsPressed.size(); i++) { switch(buttonsPressed.get(i)) { case MouseEvent.BUTTON_LEFT: modifiers |= KeyEvent.MODIFIER_BUTTON_PRIMARY; break; ...
[ "int", "getModifiers", "(", ")", "{", "int", "modifiers", "=", "KeyEvent", ".", "MODIFIER_NONE", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "buttonsPressed", ".", "size", "(", ")", ";", "i", "++", ")", "{", "switch", "(", "buttonsPressed",...
Returns the Glass event modifiers for this state
[ "Returns", "the", "Glass", "event", "modifiers", "for", "this", "state" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/MouseState.java#L105-L121
3,362
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/MouseState.java
MouseState.canBeFoldedWith
boolean canBeFoldedWith(MouseState ms) { return ms.buttonsPressed.equals(buttonsPressed) && ms.wheel == wheel; }
java
boolean canBeFoldedWith(MouseState ms) { return ms.buttonsPressed.equals(buttonsPressed) && ms.wheel == wheel; }
[ "boolean", "canBeFoldedWith", "(", "MouseState", "ms", ")", "{", "return", "ms", ".", "buttonsPressed", ".", "equals", "(", "buttonsPressed", ")", "&&", "ms", ".", "wheel", "==", "wheel", ";", "}" ]
Finds out whether two non-null states are identical in everything but their coordinates @param ms the MouseState to compare to
[ "Finds", "out", "whether", "two", "non", "-", "null", "states", "are", "identical", "in", "everything", "but", "their", "coordinates" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/MouseState.java#L151-L153
3,363
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/IntSet.java
IntSet.difference
void difference(IntSet dest, IntSet compared) { int i = 0; int j = 0; while (i < size && j < compared.size) { int a = elements[i]; int b = compared.elements[j]; if (a < b) { // our set has a value that is not in "compared" dest....
java
void difference(IntSet dest, IntSet compared) { int i = 0; int j = 0; while (i < size && j < compared.size) { int a = elements[i]; int b = compared.elements[j]; if (a < b) { // our set has a value that is not in "compared" dest....
[ "void", "difference", "(", "IntSet", "dest", ",", "IntSet", "compared", ")", "{", "int", "i", "=", "0", ";", "int", "j", "=", "0", ";", "while", "(", "i", "<", "size", "&&", "j", "<", "compared", ".", "size", ")", "{", "int", "a", "=", "element...
Adds to the set "dest" values that in this set but are not in the set "compared".
[ "Adds", "to", "the", "set", "dest", "values", "that", "in", "this", "set", "but", "are", "not", "in", "the", "set", "compared", "." ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/IntSet.java#L86-L110
3,364
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/IntSet.java
IntSet.copyTo
void copyTo(IntSet target) { if (target.elements.length < size) { target.elements = Arrays.copyOf(elements, elements.length); } else { System.arraycopy(elements, 0, target.elements, 0, size); } target.size = size; }
java
void copyTo(IntSet target) { if (target.elements.length < size) { target.elements = Arrays.copyOf(elements, elements.length); } else { System.arraycopy(elements, 0, target.elements, 0, size); } target.size = size; }
[ "void", "copyTo", "(", "IntSet", "target", ")", "{", "if", "(", "target", ".", "elements", ".", "length", "<", "size", ")", "{", "target", ".", "elements", "=", "Arrays", ".", "copyOf", "(", "elements", ",", "elements", ".", "length", ")", ";", "}", ...
Copies the contents of this set to the target set.
[ "Copies", "the", "contents", "of", "this", "set", "to", "the", "target", "set", "." ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/IntSet.java#L125-L132
3,365
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/KeyInput.java
KeyInput.setState
void setState(KeyState newState) { if (MonocleSettings.settings.traceEvents) { MonocleTrace.traceEvent("Set %s", newState); } newState.getWindow(true); // send release events state.getKeysPressed().difference(keys, newState.getKeysPressed()); if (!keys.isEmpty...
java
void setState(KeyState newState) { if (MonocleSettings.settings.traceEvents) { MonocleTrace.traceEvent("Set %s", newState); } newState.getWindow(true); // send release events state.getKeysPressed().difference(keys, newState.getKeysPressed()); if (!keys.isEmpty...
[ "void", "setState", "(", "KeyState", "newState", ")", "{", "if", "(", "MonocleSettings", ".", "settings", ".", "traceEvents", ")", "{", "MonocleTrace", ".", "traceEvent", "(", "\"Set %s\"", ",", "newState", ")", ";", "}", "newState", ".", "getWindow", "(", ...
Called from the input processor to update the key state and send key events. @param newState The updated key state
[ "Called", "from", "the", "input", "processor", "to", "update", "the", "key", "state", "and", "send", "key", "events", "." ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/KeyInput.java#L64-L100
3,366
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/NativeCursors.java
NativeCursors.colorKeyCursor
static void colorKeyCursor(byte[] source, Buffer dest, int targetDepth, int transparentPixel) { switch (targetDepth) { case 32: colorKeyCursor32(source, ...
java
static void colorKeyCursor(byte[] source, Buffer dest, int targetDepth, int transparentPixel) { switch (targetDepth) { case 32: colorKeyCursor32(source, ...
[ "static", "void", "colorKeyCursor", "(", "byte", "[", "]", "source", ",", "Buffer", "dest", ",", "int", "targetDepth", ",", "int", "transparentPixel", ")", "{", "switch", "(", "targetDepth", ")", "{", "case", "32", ":", "colorKeyCursor32", "(", "source", "...
Convert a cursor in 32-bit BYTE_ARGB_PRE format to a 16-bit or 32-bit color-keyed format @param source the cursor pixels @param dest a target ShortBuffer or IntBuffer @param targetDepth the depth of the target format (16 or 32) @param transparentPixel the color key used for transparent pixels
[ "Convert", "a", "cursor", "in", "32", "-", "bit", "BYTE_ARGB_PRE", "format", "to", "a", "16", "-", "bit", "or", "32", "-", "bit", "color", "-", "keyed", "format" ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/NativeCursors.java#L44-L60
3,367
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/NativeCursors.java
NativeCursors.offsetCursor
static void offsetCursor(Buffer sourceBuffer, Buffer destBuffer, int offsetX, int offsetY, int width, int height, int depth, int transparentPixel) { switch (depth) { ...
java
static void offsetCursor(Buffer sourceBuffer, Buffer destBuffer, int offsetX, int offsetY, int width, int height, int depth, int transparentPixel) { switch (depth) { ...
[ "static", "void", "offsetCursor", "(", "Buffer", "sourceBuffer", ",", "Buffer", "destBuffer", ",", "int", "offsetX", ",", "int", "offsetY", ",", "int", "width", ",", "int", "height", ",", "int", "depth", ",", "int", "transparentPixel", ")", "{", "switch", ...
Creates a shifted version of the source cursor. Buffers must be ShortBuffers for a bit depth of 16 or IntBuffers for a bit depth of 32. @param sourceBuffer The original cursor to be shifted @param destBuffer A buffer to receive the shifted cursor @param offsetX the number of pixels the cursor is to be shifted right @p...
[ "Creates", "a", "shifted", "version", "of", "the", "source", "cursor", ".", "Buffers", "must", "be", "ShortBuffers", "for", "a", "bit", "depth", "of", "16", "or", "IntBuffers", "for", "a", "bit", "depth", "of", "32", "." ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/NativeCursors.java#L74-L97
3,368
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/AndroidScreen.java
AndroidScreen.uploadPixels
public void uploadPixels(Buffer b, int x, int y, int width, int height, float alpha) { _uploadPixels (b, x, y, width, height, alpha); }
java
public void uploadPixels(Buffer b, int x, int y, int width, int height, float alpha) { _uploadPixels (b, x, y, width, height, alpha); }
[ "public", "void", "uploadPixels", "(", "Buffer", "b", ",", "int", "x", ",", "int", "y", ",", "int", "width", ",", "int", "height", ",", "float", "alpha", ")", "{", "_uploadPixels", "(", "b", ",", "x", ",", "y", ",", "width", ",", "height", ",", "...
Uploads a pixel buffer to the screen. Called on the JavaFX application thread. @param b Pixel data, in BYTE_BGRA_PRE format. The byte stride of the data is equal to width * 4. @param x The X offset of the pixel data on the screen @param y The Y offset of the pixel data on the screen @param width The pixel width of the...
[ "Uploads", "a", "pixel", "buffer", "to", "the", "screen", ".", "Called", "on", "the", "JavaFX", "application", "thread", "." ]
267ccba8889cab244bf8c562dbaa0345a612874c
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/AndroidScreen.java#L104-L107
3,369
groovy/gmaven
groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/BasicResourceLoader.java
BasicResourceLoader.resourceName
protected String resourceName(final String className) { String name = className; if (!name.startsWith("/")) { name = "/" + name; } if (!name.endsWith(DOT_GROOVY)) { name = name.replace('.', '/'); name += DOT_GROOVY; } return name; }
java
protected String resourceName(final String className) { String name = className; if (!name.startsWith("/")) { name = "/" + name; } if (!name.endsWith(DOT_GROOVY)) { name = name.replace('.', '/'); name += DOT_GROOVY; } return name; }
[ "protected", "String", "resourceName", "(", "final", "String", "className", ")", "{", "String", "name", "=", "className", ";", "if", "(", "!", "name", ".", "startsWith", "(", "\"/\"", ")", ")", "{", "name", "=", "\"/\"", "+", "name", ";", "}", "if", ...
Translate class-name into resource-name.
[ "Translate", "class", "-", "name", "into", "resource", "-", "name", "." ]
6978316bbc29d9cc6793494e0d1a0a057e47de6c
https://github.com/groovy/gmaven/blob/6978316bbc29d9cc6793494e0d1a0a057e47de6c/groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/BasicResourceLoader.java#L77-L90
3,370
groovy/gmaven
groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/util/GroovyVersionHelper.java
GroovyVersionHelper.getVersion
private String getVersion(final ClassLoader classLoader, final String className, final String methodName) { log.trace("Getting version; class-loader: {}, class-name: {}, method-name: {}", classLoader, className, methodName); try { Class<?> type = classLoader.loadClass(className); Method met...
java
private String getVersion(final ClassLoader classLoader, final String className, final String methodName) { log.trace("Getting version; class-loader: {}, class-name: {}, method-name: {}", classLoader, className, methodName); try { Class<?> type = classLoader.loadClass(className); Method met...
[ "private", "String", "getVersion", "(", "final", "ClassLoader", "classLoader", ",", "final", "String", "className", ",", "final", "String", "methodName", ")", "{", "log", ".", "trace", "(", "\"Getting version; class-loader: {}, class-name: {}, method-name: {}\"", ",", "...
Get version from Groovy version helper utilities via reflection.
[ "Get", "version", "from", "Groovy", "version", "helper", "utilities", "via", "reflection", "." ]
6978316bbc29d9cc6793494e0d1a0a057e47de6c
https://github.com/groovy/gmaven/blob/6978316bbc29d9cc6793494e0d1a0a057e47de6c/groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/util/GroovyVersionHelper.java#L77-L94
3,371
groovy/gmaven
groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/util/VersionHelper.java
VersionHelper.before
public VersionRange before(final int... parts) { checkNotNull(parts); checkArgument(parts.length != 0); StringBuilder buff = new StringBuilder() .append("(,"); for (int i = 0; i < parts.length; i++) { buff.append(parts[i]); if (i + 1 < parts.length) { buff.append("."); ...
java
public VersionRange before(final int... parts) { checkNotNull(parts); checkArgument(parts.length != 0); StringBuilder buff = new StringBuilder() .append("(,"); for (int i = 0; i < parts.length; i++) { buff.append(parts[i]); if (i + 1 < parts.length) { buff.append("."); ...
[ "public", "VersionRange", "before", "(", "final", "int", "...", "parts", ")", "{", "checkNotNull", "(", "parts", ")", ";", "checkArgument", "(", "parts", ".", "length", "!=", "0", ")", ";", "StringBuilder", "buff", "=", "new", "StringBuilder", "(", ")", ...
Builds a range before version parts.
[ "Builds", "a", "range", "before", "version", "parts", "." ]
6978316bbc29d9cc6793494e0d1a0a057e47de6c
https://github.com/groovy/gmaven/blob/6978316bbc29d9cc6793494e0d1a0a057e47de6c/groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/util/VersionHelper.java#L129-L150
3,372
groovy/gmaven
groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/RuntimeMojoSupport.java
RuntimeMojoSupport.resolveBasedir
private File resolveBasedir() throws IOException { String path = null; if (project != null) { File file = project.getBasedir(); if (file != null) { path = file.getAbsolutePath(); } } if (path == null) { path = session.getExecutionRootDirectory(); } if (path == ...
java
private File resolveBasedir() throws IOException { String path = null; if (project != null) { File file = project.getBasedir(); if (file != null) { path = file.getAbsolutePath(); } } if (path == null) { path = session.getExecutionRootDirectory(); } if (path == ...
[ "private", "File", "resolveBasedir", "(", ")", "throws", "IOException", "{", "String", "path", "=", "null", ";", "if", "(", "project", "!=", "null", ")", "{", "File", "file", "=", "project", ".", "getBasedir", "(", ")", ";", "if", "(", "file", "!=", ...
Resolves the base directory for the current execution.
[ "Resolves", "the", "base", "directory", "for", "the", "current", "execution", "." ]
6978316bbc29d9cc6793494e0d1a0a057e47de6c
https://github.com/groovy/gmaven/blob/6978316bbc29d9cc6793494e0d1a0a057e47de6c/groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/RuntimeMojoSupport.java#L183-L202
3,373
groovy/gmaven
groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/RuntimeMojoSupport.java
RuntimeMojoSupport.ensureMavenCompatibility
private void ensureMavenCompatibility(final ClassLoader classLoader) throws MojoExecutionException { Version mavenVersion = mavenVersionHelper.detectVersion(classLoader); if (mavenVersion == null) { // complain and continue log.error("Unable to determine Maven version"); } else { log.d...
java
private void ensureMavenCompatibility(final ClassLoader classLoader) throws MojoExecutionException { Version mavenVersion = mavenVersionHelper.detectVersion(classLoader); if (mavenVersion == null) { // complain and continue log.error("Unable to determine Maven version"); } else { log.d...
[ "private", "void", "ensureMavenCompatibility", "(", "final", "ClassLoader", "classLoader", ")", "throws", "MojoExecutionException", "{", "Version", "mavenVersion", "=", "mavenVersionHelper", ".", "detectVersion", "(", "classLoader", ")", ";", "if", "(", "mavenVersion", ...
Ensure Maven compatibility. Requires Maven 3+
[ "Ensure", "Maven", "compatibility", ".", "Requires", "Maven", "3", "+" ]
6978316bbc29d9cc6793494e0d1a0a057e47de6c
https://github.com/groovy/gmaven/blob/6978316bbc29d9cc6793494e0d1a0a057e47de6c/groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/RuntimeMojoSupport.java#L224-L236
3,374
groovy/gmaven
groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/RuntimeMojoSupport.java
RuntimeMojoSupport.ensureGroovyComparability
private void ensureGroovyComparability(final ClassLoader classLoader) throws MojoExecutionException { Version groovyVersion = groovyVersionHelper.detectVersion(classLoader); if (groovyVersion == null) { // complain and continue log.error("Unable to determine Groovy version"); } else { ...
java
private void ensureGroovyComparability(final ClassLoader classLoader) throws MojoExecutionException { Version groovyVersion = groovyVersionHelper.detectVersion(classLoader); if (groovyVersion == null) { // complain and continue log.error("Unable to determine Groovy version"); } else { ...
[ "private", "void", "ensureGroovyComparability", "(", "final", "ClassLoader", "classLoader", ")", "throws", "MojoExecutionException", "{", "Version", "groovyVersion", "=", "groovyVersionHelper", ".", "detectVersion", "(", "classLoader", ")", ";", "if", "(", "groovyVersio...
Ensure Groovy compatibility. Requires Groovy 2+
[ "Ensure", "Groovy", "compatibility", ".", "Requires", "Groovy", "2", "+" ]
6978316bbc29d9cc6793494e0d1a0a057e47de6c
https://github.com/groovy/gmaven/blob/6978316bbc29d9cc6793494e0d1a0a057e47de6c/groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/RuntimeMojoSupport.java#L241-L253
3,375
groovy/gmaven
groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/RuntimeMojoSupport.java
RuntimeMojoSupport.configureAdditionalClasspath
private void configureAdditionalClasspath(final ClassRealm realm) { log.debug("Configuring additional classpath with scope: {}", classpathScope); List<File> classpath = Lists.newArrayList(); // add build output directory if scope includes 'compile' if (classpathScope.matches(compile)) { classpat...
java
private void configureAdditionalClasspath(final ClassRealm realm) { log.debug("Configuring additional classpath with scope: {}", classpathScope); List<File> classpath = Lists.newArrayList(); // add build output directory if scope includes 'compile' if (classpathScope.matches(compile)) { classpat...
[ "private", "void", "configureAdditionalClasspath", "(", "final", "ClassRealm", "realm", ")", "{", "log", ".", "debug", "(", "\"Configuring additional classpath with scope: {}\"", ",", "classpathScope", ")", ";", "List", "<", "File", ">", "classpath", "=", "Lists", "...
Configure additional classpath elements for the runtime realm.
[ "Configure", "additional", "classpath", "elements", "for", "the", "runtime", "realm", "." ]
6978316bbc29d9cc6793494e0d1a0a057e47de6c
https://github.com/groovy/gmaven/blob/6978316bbc29d9cc6793494e0d1a0a057e47de6c/groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/RuntimeMojoSupport.java#L258-L300
3,376
groovy/gmaven
groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/RuntimeMojoSupport.java
RuntimeMojoSupport.createLogger
private Logger createLogger() { String loggerName = String.format("%s.%s.Script", project.getGroupId(), project.getArtifactId()); return LoggerFactory.getLogger(loggerName); }
java
private Logger createLogger() { String loggerName = String.format("%s.%s.Script", project.getGroupId(), project.getArtifactId()); return LoggerFactory.getLogger(loggerName); }
[ "private", "Logger", "createLogger", "(", ")", "{", "String", "loggerName", "=", "String", ".", "format", "(", "\"%s.%s.Script\"", ",", "project", ".", "getGroupId", "(", ")", ",", "project", ".", "getArtifactId", "(", ")", ")", ";", "return", "LoggerFactory...
Create script logger.
[ "Create", "script", "logger", "." ]
6978316bbc29d9cc6793494e0d1a0a057e47de6c
https://github.com/groovy/gmaven/blob/6978316bbc29d9cc6793494e0d1a0a057e47de6c/groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/RuntimeMojoSupport.java#L305-L308
3,377
groovy/gmaven
groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/RuntimeMojoSupport.java
RuntimeMojoSupport.createProperties
private Properties createProperties() { propertiesBuilder .setProject(project) .setSession(session); customizeProperties(propertiesBuilder); // convert to Properties for better compatibility, groovy doesn't care about types so its not a big deal Properties props = new Properties(); pro...
java
private Properties createProperties() { propertiesBuilder .setProject(project) .setSession(session); customizeProperties(propertiesBuilder); // convert to Properties for better compatibility, groovy doesn't care about types so its not a big deal Properties props = new Properties(); pro...
[ "private", "Properties", "createProperties", "(", ")", "{", "propertiesBuilder", ".", "setProject", "(", "project", ")", ".", "setSession", "(", "session", ")", ";", "customizeProperties", "(", "propertiesBuilder", ")", ";", "// convert to Properties for better compatib...
Create script execution properties.
[ "Create", "script", "execution", "properties", "." ]
6978316bbc29d9cc6793494e0d1a0a057e47de6c
https://github.com/groovy/gmaven/blob/6978316bbc29d9cc6793494e0d1a0a057e47de6c/groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/RuntimeMojoSupport.java#L313-L324
3,378
groovy/gmaven
groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/RuntimeMojoSupport.java
RuntimeMojoSupport.createContext
protected Map<String, Object> createContext() { Map<String, Object> context = Maps.newHashMap(); context.put("log", createLogger()); context.put("container", containerHelper); context.put("plugin", pluginDescriptor); context.put("pluginContext", getPluginContext()); context.put("mojo", mojoExec...
java
protected Map<String, Object> createContext() { Map<String, Object> context = Maps.newHashMap(); context.put("log", createLogger()); context.put("container", containerHelper); context.put("plugin", pluginDescriptor); context.put("pluginContext", getPluginContext()); context.put("mojo", mojoExec...
[ "protected", "Map", "<", "String", ",", "Object", ">", "createContext", "(", ")", "{", "Map", "<", "String", ",", "Object", ">", "context", "=", "Maps", ".", "newHashMap", "(", ")", ";", "context", ".", "put", "(", "\"log\"", ",", "createLogger", "(", ...
Configures the context which will be available to executed scripts as binding variables.
[ "Configures", "the", "context", "which", "will", "be", "available", "to", "executed", "scripts", "as", "binding", "variables", "." ]
6978316bbc29d9cc6793494e0d1a0a057e47de6c
https://github.com/groovy/gmaven/blob/6978316bbc29d9cc6793494e0d1a0a057e47de6c/groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/RuntimeMojoSupport.java#L336-L353
3,379
groovy/gmaven
groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/ClassSourceFactory.java
ClassSourceFactory.create
public ClassSource create(final String source) { checkNotNull(source); String trimmed = source.trim(); log.trace("Creating class-source from: {}", trimmed); // First try and parse the source as a URL try { return new ClassSourceImpl(new URL(trimmed), null, null); } catch (MalformedUR...
java
public ClassSource create(final String source) { checkNotNull(source); String trimmed = source.trim(); log.trace("Creating class-source from: {}", trimmed); // First try and parse the source as a URL try { return new ClassSourceImpl(new URL(trimmed), null, null); } catch (MalformedUR...
[ "public", "ClassSource", "create", "(", "final", "String", "source", ")", "{", "checkNotNull", "(", "source", ")", ";", "String", "trimmed", "=", "source", ".", "trim", "(", ")", ";", "log", ".", "trace", "(", "\"Creating class-source from: {}\"", ",", "trim...
Create a class-source from the given source.
[ "Create", "a", "class", "-", "source", "from", "the", "given", "source", "." ]
6978316bbc29d9cc6793494e0d1a0a057e47de6c
https://github.com/groovy/gmaven/blob/6978316bbc29d9cc6793494e0d1a0a057e47de6c/groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/ClassSourceFactory.java#L130-L160
3,380
scalecube/socketio
src/main/java/io/scalecube/socketio/SocketIOServer.java
SocketIOServer.start
public synchronized void start() { if (isStarted()) { throw new IllegalStateException("Failed to start Socket.IO server: server already started"); } log.info("Socket.IO server starting"); // Configure heartbeat scheduler timer = new HashedWheelTimer(); timer.start(); SocketIOHeartbea...
java
public synchronized void start() { if (isStarted()) { throw new IllegalStateException("Failed to start Socket.IO server: server already started"); } log.info("Socket.IO server starting"); // Configure heartbeat scheduler timer = new HashedWheelTimer(); timer.start(); SocketIOHeartbea...
[ "public", "synchronized", "void", "start", "(", ")", "{", "if", "(", "isStarted", "(", ")", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Failed to start Socket.IO server: server already started\"", ")", ";", "}", "log", ".", "info", "(", "\"Socket.IO...
Starts Socket.IO server with current configuration settings. @throws IllegalStateException if server already started
[ "Starts", "Socket", ".", "IO", "server", "with", "current", "configuration", "settings", "." ]
bad28fe7a132320750173e7cb71ad6d3688fb626
https://github.com/scalecube/socketio/blob/bad28fe7a132320750173e7cb71ad6d3688fb626/src/main/java/io/scalecube/socketio/SocketIOServer.java#L103-L127
3,381
scalecube/socketio
src/main/java/io/scalecube/socketio/SocketIOServer.java
SocketIOServer.stop
public synchronized void stop() { if (isStopped()) { throw new IllegalStateException("Failed to stop Socket.IO server: server already stopped"); } log.info("Socket.IO server stopping"); timer.stop(); bootstrap.config().group().shutdownGracefully().syncUninterruptibly(); state = State.STO...
java
public synchronized void stop() { if (isStopped()) { throw new IllegalStateException("Failed to stop Socket.IO server: server already stopped"); } log.info("Socket.IO server stopping"); timer.stop(); bootstrap.config().group().shutdownGracefully().syncUninterruptibly(); state = State.STO...
[ "public", "synchronized", "void", "stop", "(", ")", "{", "if", "(", "isStopped", "(", ")", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Failed to stop Socket.IO server: server already stopped\"", ")", ";", "}", "log", ".", "info", "(", "\"Socket.IO s...
Stops Socket.IO server. @throws IllegalStateException if server already stopped
[ "Stops", "Socket", ".", "IO", "server", "." ]
bad28fe7a132320750173e7cb71ad6d3688fb626
https://github.com/scalecube/socketio/blob/bad28fe7a132320750173e7cb71ad6d3688fb626/src/main/java/io/scalecube/socketio/SocketIOServer.java#L135-L147
3,382
scalecube/socketio
src/main/java/io/scalecube/socketio/pipeline/ResourceHandler.java
ResourceHandler.sendError
private void sendError(ChannelHandlerContext ctx, HttpResponseStatus status) { HttpResponse response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, status); response.headers().set(HttpHeaderNames.CONTENT_TYPE, "text/plain; charset=UTF-8"); ByteBuf content = Unpooled.copiedBuffer("Failure: " + status.toStri...
java
private void sendError(ChannelHandlerContext ctx, HttpResponseStatus status) { HttpResponse response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, status); response.headers().set(HttpHeaderNames.CONTENT_TYPE, "text/plain; charset=UTF-8"); ByteBuf content = Unpooled.copiedBuffer("Failure: " + status.toStri...
[ "private", "void", "sendError", "(", "ChannelHandlerContext", "ctx", ",", "HttpResponseStatus", "status", ")", "{", "HttpResponse", "response", "=", "new", "DefaultHttpResponse", "(", "HttpVersion", ".", "HTTP_1_1", ",", "status", ")", ";", "response", ".", "heade...
Sends an Error response with status message @param ctx channel context @param status status
[ "Sends", "an", "Error", "response", "with", "status", "message" ]
bad28fe7a132320750173e7cb71ad6d3688fb626
https://github.com/scalecube/socketio/blob/bad28fe7a132320750173e7cb71ad6d3688fb626/src/main/java/io/scalecube/socketio/pipeline/ResourceHandler.java#L168-L176
3,383
amazon-archives/aws-scala-sdk
project-generator/src/main/java/com/amazonaws/scala/ProjectGenerator.java
ProjectGenerator.main
public static void main(String[] args) throws Exception { if (args.length != 1) { System.err.println("usage: generator <basedir>"); System.exit(-1); } File baseDir = new File(args[0]); System.out.println("Using baseDir: " + baseDir.getAbsolutePath()); ne...
java
public static void main(String[] args) throws Exception { if (args.length != 1) { System.err.println("usage: generator <basedir>"); System.exit(-1); } File baseDir = new File(args[0]); System.out.println("Using baseDir: " + baseDir.getAbsolutePath()); ne...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "throws", "Exception", "{", "if", "(", "args", ".", "length", "!=", "1", ")", "{", "System", ".", "err", ".", "println", "(", "\"usage: generator <basedir>\"", ")", ";", "System", ...
Main point of entry from the command line. Pass the base directory for generation as the only argument.
[ "Main", "point", "of", "entry", "from", "the", "command", "line", ".", "Pass", "the", "base", "directory", "for", "generation", "as", "the", "only", "argument", "." ]
b999cdb8342231a8dce7c59cb40dc2b0b4684224
https://github.com/amazon-archives/aws-scala-sdk/blob/b999cdb8342231a8dce7c59cb40dc2b0b4684224/project-generator/src/main/java/com/amazonaws/scala/ProjectGenerator.java#L123-L133
3,384
open-pay/openpay-java
src/main/java/mx/openpay/client/Plan.java
Plan.repeatEvery
public Plan repeatEvery(final Integer repeatEvery, final PlanRepeatUnit unit) { this.repeatEvery = repeatEvery; this.repeatUnit = unit == null ? null : unit.name().toLowerCase(); return this; }
java
public Plan repeatEvery(final Integer repeatEvery, final PlanRepeatUnit unit) { this.repeatEvery = repeatEvery; this.repeatUnit = unit == null ? null : unit.name().toLowerCase(); return this; }
[ "public", "Plan", "repeatEvery", "(", "final", "Integer", "repeatEvery", ",", "final", "PlanRepeatUnit", "unit", ")", "{", "this", ".", "repeatEvery", "=", "repeatEvery", ";", "this", ".", "repeatUnit", "=", "unit", "==", "null", "?", "null", ":", "unit", ...
The duration of each cycle. Required.
[ "The", "duration", "of", "each", "cycle", ".", "Required", "." ]
7f4220466b394dd54e2b1642821dde7daebc5433
https://github.com/open-pay/openpay-java/blob/7f4220466b394dd54e2b1642821dde7daebc5433/src/main/java/mx/openpay/client/Plan.java#L84-L88
3,385
open-pay/openpay-java
src/main/java/mx/openpay/client/core/operations/ChargeOperations.java
ChargeOperations.createCharge
public Charge createCharge(RequestBuilder request) throws OpenpayServiceException, ServiceUnavailableException { String path = String.format(FOR_MERCHANT_PATH, this.getMerchantId()); return this.getJsonClient().post(path, request.asMap(), Charge.class); }
java
public Charge createCharge(RequestBuilder request) throws OpenpayServiceException, ServiceUnavailableException { String path = String.format(FOR_MERCHANT_PATH, this.getMerchantId()); return this.getJsonClient().post(path, request.asMap(), Charge.class); }
[ "public", "Charge", "createCharge", "(", "RequestBuilder", "request", ")", "throws", "OpenpayServiceException", ",", "ServiceUnavailableException", "{", "String", "path", "=", "String", ".", "format", "(", "FOR_MERCHANT_PATH", ",", "this", ".", "getMerchantId", "(", ...
Creates any kind of charge at the Merchant level. @param request Generic request params. @return Charge data returned by Openpay @throws OpenpayServiceException When Openpay returns an error response @throws ServiceUnavailableException When an unexpected communication error occurs. @since 1.0.10
[ "Creates", "any", "kind", "of", "charge", "at", "the", "Merchant", "level", "." ]
7f4220466b394dd54e2b1642821dde7daebc5433
https://github.com/open-pay/openpay-java/blob/7f4220466b394dd54e2b1642821dde7daebc5433/src/main/java/mx/openpay/client/core/operations/ChargeOperations.java#L84-L87
3,386
open-pay/openpay-java
src/main/java/mx/openpay/client/core/operations/ChargeOperations.java
ChargeOperations.confirmCapture
public Charge confirmCapture(final ConfirmCaptureParams params) throws OpenpayServiceException, ServiceUnavailableException { String path = String.format(CAPTURE_FOR_MERCHANT_PATH, this.getMerchantId(), params.getChargeId()); return this.getJsonClient().post(path, params.asMap(), Charge.clas...
java
public Charge confirmCapture(final ConfirmCaptureParams params) throws OpenpayServiceException, ServiceUnavailableException { String path = String.format(CAPTURE_FOR_MERCHANT_PATH, this.getMerchantId(), params.getChargeId()); return this.getJsonClient().post(path, params.asMap(), Charge.clas...
[ "public", "Charge", "confirmCapture", "(", "final", "ConfirmCaptureParams", "params", ")", "throws", "OpenpayServiceException", ",", "ServiceUnavailableException", "{", "String", "path", "=", "String", ".", "format", "(", "CAPTURE_FOR_MERCHANT_PATH", ",", "this", ".", ...
Confirms a charge that was made with the option capture set to false.
[ "Confirms", "a", "charge", "that", "was", "made", "with", "the", "option", "capture", "set", "to", "false", "." ]
7f4220466b394dd54e2b1642821dde7daebc5433
https://github.com/open-pay/openpay-java/blob/7f4220466b394dd54e2b1642821dde7daebc5433/src/main/java/mx/openpay/client/core/operations/ChargeOperations.java#L155-L159
3,387
open-pay/openpay-java
src/main/java/mx/openpay/client/core/operations/ChargeOperations.java
ChargeOperations.confirmCharge
public Charge confirmCharge(final ConfirmChargeParams params) throws OpenpayServiceException, ServiceUnavailableException { String path = String.format(CONFIRM_FOR_MERCHANT_PATH, this.getMerchantId(), params.getChargeId()); return this.getJsonClient().post(path, params.asMap(), Charge.class)...
java
public Charge confirmCharge(final ConfirmChargeParams params) throws OpenpayServiceException, ServiceUnavailableException { String path = String.format(CONFIRM_FOR_MERCHANT_PATH, this.getMerchantId(), params.getChargeId()); return this.getJsonClient().post(path, params.asMap(), Charge.class)...
[ "public", "Charge", "confirmCharge", "(", "final", "ConfirmChargeParams", "params", ")", "throws", "OpenpayServiceException", ",", "ServiceUnavailableException", "{", "String", "path", "=", "String", ".", "format", "(", "CONFIRM_FOR_MERCHANT_PATH", ",", "this", ".", "...
Confirms a charge that was made with the option confirm set to false.
[ "Confirms", "a", "charge", "that", "was", "made", "with", "the", "option", "confirm", "set", "to", "false", "." ]
7f4220466b394dd54e2b1642821dde7daebc5433
https://github.com/open-pay/openpay-java/blob/7f4220466b394dd54e2b1642821dde7daebc5433/src/main/java/mx/openpay/client/core/operations/ChargeOperations.java#L174-L178
3,388
open-pay/openpay-java
src/main/java/mx/openpay/client/core/operations/ChargeOperations.java
ChargeOperations.create
@Deprecated public Charge create(final String customerId, final CreateStoreChargeParams request) throws OpenpayServiceException, ServiceUnavailableException { return createCharge(customerId, request); }
java
@Deprecated public Charge create(final String customerId, final CreateStoreChargeParams request) throws OpenpayServiceException, ServiceUnavailableException { return createCharge(customerId, request); }
[ "@", "Deprecated", "public", "Charge", "create", "(", "final", "String", "customerId", ",", "final", "CreateStoreChargeParams", "request", ")", "throws", "OpenpayServiceException", ",", "ServiceUnavailableException", "{", "return", "createCharge", "(", "customerId", ","...
Creates a store charge at the Customer level. @param customerId ID of the Customer created previously in Openpay. @param request Store charge params @return Charge data returned by Openpay @throws OpenpayServiceException When Openpay returns an error response @throws ServiceUnavailableException When an unexpected commu...
[ "Creates", "a", "store", "charge", "at", "the", "Customer", "level", "." ]
7f4220466b394dd54e2b1642821dde7daebc5433
https://github.com/open-pay/openpay-java/blob/7f4220466b394dd54e2b1642821dde7daebc5433/src/main/java/mx/openpay/client/core/operations/ChargeOperations.java#L341-L345
3,389
open-pay/openpay-java
src/main/java/mx/openpay/client/core/operations/OpenpayFeesOperations.java
OpenpayFeesOperations.getSummary
public OpenpayFeesSummary getSummary(final int year, final int month) throws OpenpayServiceException, ServiceUnavailableException { String path = String.format(FEES_PATH, this.getMerchantId()); Map<String, String> params = new HashMap<String, String>(); params.put("year", String.valu...
java
public OpenpayFeesSummary getSummary(final int year, final int month) throws OpenpayServiceException, ServiceUnavailableException { String path = String.format(FEES_PATH, this.getMerchantId()); Map<String, String> params = new HashMap<String, String>(); params.put("year", String.valu...
[ "public", "OpenpayFeesSummary", "getSummary", "(", "final", "int", "year", ",", "final", "int", "month", ")", "throws", "OpenpayServiceException", ",", "ServiceUnavailableException", "{", "String", "path", "=", "String", ".", "format", "(", "FEES_PATH", ",", "this...
Retrieve the summary of the charged fees in the given month. The amounts retrieved in the current month may change on a daily basis. @param year Year of the date to retrieve @param month Month to retrieve @return The summary of the fees charged by Openpay. @throws OpenpayServiceException If the service returns an error...
[ "Retrieve", "the", "summary", "of", "the", "charged", "fees", "in", "the", "given", "month", ".", "The", "amounts", "retrieved", "in", "the", "current", "month", "may", "change", "on", "a", "daily", "basis", "." ]
7f4220466b394dd54e2b1642821dde7daebc5433
https://github.com/open-pay/openpay-java/blob/7f4220466b394dd54e2b1642821dde7daebc5433/src/main/java/mx/openpay/client/core/operations/OpenpayFeesOperations.java#L58-L65
3,390
open-pay/openpay-java
src/main/java/mx/openpay/client/core/operations/OpenpayFeesOperations.java
OpenpayFeesOperations.getDetails
public List<GenericTransaction> getDetails(final int year, final int month, final FeeDetailsType feeType, final PaginationParams pagination) throws OpenpayServiceException, ServiceUnavailableException { String path = String.format(FEES_DETAILS_PATH, this.getMerchantId()); Map<String, String>...
java
public List<GenericTransaction> getDetails(final int year, final int month, final FeeDetailsType feeType, final PaginationParams pagination) throws OpenpayServiceException, ServiceUnavailableException { String path = String.format(FEES_DETAILS_PATH, this.getMerchantId()); Map<String, String>...
[ "public", "List", "<", "GenericTransaction", ">", "getDetails", "(", "final", "int", "year", ",", "final", "int", "month", ",", "final", "FeeDetailsType", "feeType", ",", "final", "PaginationParams", "pagination", ")", "throws", "OpenpayServiceException", ",", "Se...
Retrieves the list of transactions that affected the charged or refunded fees on a given month. Transactions in the CHARGED or REFUNDED type of detail add their fee to the total, while the ones in CHARGED_ADJUSTMENTS and REFUNDED_ADJUSTMENTS add their amount. @param year Year to report @param month Month to report @par...
[ "Retrieves", "the", "list", "of", "transactions", "that", "affected", "the", "charged", "or", "refunded", "fees", "on", "a", "given", "month", ".", "Transactions", "in", "the", "CHARGED", "or", "REFUNDED", "type", "of", "detail", "add", "their", "fee", "to",...
7f4220466b394dd54e2b1642821dde7daebc5433
https://github.com/open-pay/openpay-java/blob/7f4220466b394dd54e2b1642821dde7daebc5433/src/main/java/mx/openpay/client/core/operations/OpenpayFeesOperations.java#L79-L90
3,391
open-pay/openpay-java
src/main/java/mx/openpay/client/core/requests/RequestBuilder.java
RequestBuilder.with
@SuppressWarnings("unchecked") public <T extends RequestBuilder> T with(final String jsonParam, final Object obj) { this.parameters.put(jsonParam, obj); return (T) this; }
java
@SuppressWarnings("unchecked") public <T extends RequestBuilder> T with(final String jsonParam, final Object obj) { this.parameters.put(jsonParam, obj); return (T) this; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "T", "extends", "RequestBuilder", ">", "T", "with", "(", "final", "String", "jsonParam", ",", "final", "Object", "obj", ")", "{", "this", ".", "parameters", ".", "put", "(", "jsonParam", ",...
Adds the given parameter to the map and returns this same object. @param jsonParam JSON name of the parameter to add @param obj Object to add to the map @return This same object
[ "Adds", "the", "given", "parameter", "to", "the", "map", "and", "returns", "this", "same", "object", "." ]
7f4220466b394dd54e2b1642821dde7daebc5433
https://github.com/open-pay/openpay-java/blob/7f4220466b394dd54e2b1642821dde7daebc5433/src/main/java/mx/openpay/client/core/requests/RequestBuilder.java#L37-L41
3,392
open-pay/openpay-java
src/main/java/mx/openpay/client/Webhook.java
Webhook.addEventTypes
public Webhook addEventTypes(final String eventType) { if (this.eventTypes == null) { this.eventTypes = new ArrayList<String>(); } this.eventTypes.add(eventType); return this; }
java
public Webhook addEventTypes(final String eventType) { if (this.eventTypes == null) { this.eventTypes = new ArrayList<String>(); } this.eventTypes.add(eventType); return this; }
[ "public", "Webhook", "addEventTypes", "(", "final", "String", "eventType", ")", "{", "if", "(", "this", ".", "eventTypes", "==", "null", ")", "{", "this", ".", "eventTypes", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "}", "this", ".", ...
Webhook eventType. Required. @return Returns the object Webhook
[ "Webhook", "eventType", ".", "Required", "." ]
7f4220466b394dd54e2b1642821dde7daebc5433
https://github.com/open-pay/openpay-java/blob/7f4220466b394dd54e2b1642821dde7daebc5433/src/main/java/mx/openpay/client/Webhook.java#L112-L118
3,393
open-pay/openpay-java
src/main/java/mx/openpay/client/core/operations/TransactionsPayoutOperations.java
TransactionsPayoutOperations.getResume
public TransactionsPayoutResume getResume(final String payoutId) throws OpenpayServiceException, ServiceUnavailableException { String path = String.format(PAYOUT_TRANSACTIONS_PATH, this.getMerchantId(), payoutId); return this.getJsonClient().get(path, TransactionsPayoutResume.class); }
java
public TransactionsPayoutResume getResume(final String payoutId) throws OpenpayServiceException, ServiceUnavailableException { String path = String.format(PAYOUT_TRANSACTIONS_PATH, this.getMerchantId(), payoutId); return this.getJsonClient().get(path, TransactionsPayoutResume.class); }
[ "public", "TransactionsPayoutResume", "getResume", "(", "final", "String", "payoutId", ")", "throws", "OpenpayServiceException", ",", "ServiceUnavailableException", "{", "String", "path", "=", "String", ".", "format", "(", "PAYOUT_TRANSACTIONS_PATH", ",", "this", ".", ...
Retrieve the resume of the transactions of the given payoutid. @param payoutId The payoutid. @return The transactions resume. @throws OpenpayServiceException If the service returns an error @throws ServiceUnavailableException If the service is not available
[ "Retrieve", "the", "resume", "of", "the", "transactions", "of", "the", "given", "payoutid", "." ]
7f4220466b394dd54e2b1642821dde7daebc5433
https://github.com/open-pay/openpay-java/blob/7f4220466b394dd54e2b1642821dde7daebc5433/src/main/java/mx/openpay/client/core/operations/TransactionsPayoutOperations.java#L62-L66
3,394
open-pay/openpay-java
src/main/java/mx/openpay/client/core/operations/TransactionsPayoutOperations.java
TransactionsPayoutOperations.getDetails
public List<GenericTransaction> getDetails(final String payoutId, final TransactionsPayoutType transactionsPayoutType, final PaginationParams pagination) throws OpenpayServiceException, ServiceUnavailableException { String path = String.format(PAYOUT_TRANSACTIONS_DETAILS_PATH, this.getMerchantId(), payoutId); ...
java
public List<GenericTransaction> getDetails(final String payoutId, final TransactionsPayoutType transactionsPayoutType, final PaginationParams pagination) throws OpenpayServiceException, ServiceUnavailableException { String path = String.format(PAYOUT_TRANSACTIONS_DETAILS_PATH, this.getMerchantId(), payoutId); ...
[ "public", "List", "<", "GenericTransaction", ">", "getDetails", "(", "final", "String", "payoutId", ",", "final", "TransactionsPayoutType", "transactionsPayoutType", ",", "final", "PaginationParams", "pagination", ")", "throws", "OpenpayServiceException", ",", "ServiceUna...
Retrieves the list of transactions that affected the payout. . Transactions in the IN or OUT type of detail add their fee to the total, while the ones in CHARGED_ADJUSTMENTS and REFUNDED_ADJUSTMENTS add their amount. @param payoutId the payout id @param transactionsPayoutType the transactions payout type @param pagina...
[ "Retrieves", "the", "list", "of", "transactions", "that", "affected", "the", "payout", ".", ".", "Transactions", "in", "the", "IN", "or", "OUT", "type", "of", "detail", "add", "their", "fee", "to", "the", "total", "while", "the", "ones", "in", "CHARGED_ADJ...
7f4220466b394dd54e2b1642821dde7daebc5433
https://github.com/open-pay/openpay-java/blob/7f4220466b394dd54e2b1642821dde7daebc5433/src/main/java/mx/openpay/client/core/operations/TransactionsPayoutOperations.java#L87-L97
3,395
fuzzylite/jfuzzylite
jfuzzylite/src/main/java/com/fuzzylite/activation/First.java
First.configure
@Override public void configure(String parameters) { if (parameters.isEmpty()) { return; } List<String> values = Op.split(parameters, " ", true); final int required = 2; if (values.size() < required) { throw new RuntimeException(MessageFormat.format( ...
java
@Override public void configure(String parameters) { if (parameters.isEmpty()) { return; } List<String> values = Op.split(parameters, " ", true); final int required = 2; if (values.size() < required) { throw new RuntimeException(MessageFormat.format( ...
[ "@", "Override", "public", "void", "configure", "(", "String", "parameters", ")", "{", "if", "(", "parameters", ".", "isEmpty", "(", ")", ")", "{", "return", ";", "}", "List", "<", "String", ">", "values", "=", "Op", ".", "split", "(", "parameters", ...
Configures the activation method with the given number of rules and threshold @param parameters as "numberOfRules threshold"
[ "Configures", "the", "activation", "method", "with", "the", "given", "number", "of", "rules", "and", "threshold" ]
583ac1928f39512af75de80d560e67448039595a
https://github.com/fuzzylite/jfuzzylite/blob/583ac1928f39512af75de80d560e67448039595a/jfuzzylite/src/main/java/com/fuzzylite/activation/First.java#L77-L92
3,396
fuzzylite/jfuzzylite
jfuzzylite/src/main/java/com/fuzzylite/term/Linear.java
Linear.create
public static Linear create(String name, Engine engine, double... coefficients) { List<Double> coefficientsList = new ArrayList<Double>(coefficients.length); for (double coefficient : coefficients) { coefficientsList.add(coefficient); } return new Linear(name, coe...
java
public static Linear create(String name, Engine engine, double... coefficients) { List<Double> coefficientsList = new ArrayList<Double>(coefficients.length); for (double coefficient : coefficients) { coefficientsList.add(coefficient); } return new Linear(name, coe...
[ "public", "static", "Linear", "create", "(", "String", "name", ",", "Engine", "engine", ",", "double", "...", "coefficients", ")", "{", "List", "<", "Double", ">", "coefficientsList", "=", "new", "ArrayList", "<", "Double", ">", "(", "coefficients", ".", "...
Creates a Linear term from a variadic set of coefficients. The number of variadic arguments should be the same as the number of input variables in the engine plus one in order to match the size of the list `\mathbf{c}^\star` @param name is the name of the term @param engine is the engine from which the vector `\mathb...
[ "Creates", "a", "Linear", "term", "from", "a", "variadic", "set", "of", "coefficients", ".", "The", "number", "of", "variadic", "arguments", "should", "be", "the", "same", "as", "the", "number", "of", "input", "variables", "in", "the", "engine", "plus", "o...
583ac1928f39512af75de80d560e67448039595a
https://github.com/fuzzylite/jfuzzylite/blob/583ac1928f39512af75de80d560e67448039595a/jfuzzylite/src/main/java/com/fuzzylite/term/Linear.java#L108-L115
3,397
fuzzylite/jfuzzylite
jfuzzylite/src/main/java/com/fuzzylite/factory/CloningFactory.java
CloningFactory.getObject
public T getObject(String key) { if (this.objects.containsKey(key)) { return this.objects.get(key); } return null; }
java
public T getObject(String key) { if (this.objects.containsKey(key)) { return this.objects.get(key); } return null; }
[ "public", "T", "getObject", "(", "String", "key", ")", "{", "if", "(", "this", ".", "objects", ".", "containsKey", "(", "key", ")", ")", "{", "return", "this", ".", "objects", ".", "get", "(", "key", ")", ";", "}", "return", "null", ";", "}" ]
Gets the object registered by the given key, not a clone of the object @param key is the unique name by which objects are registered @return the object registered by the given key
[ "Gets", "the", "object", "registered", "by", "the", "given", "key", "not", "a", "clone", "of", "the", "object" ]
583ac1928f39512af75de80d560e67448039595a
https://github.com/fuzzylite/jfuzzylite/blob/583ac1928f39512af75de80d560e67448039595a/jfuzzylite/src/main/java/com/fuzzylite/factory/CloningFactory.java#L81-L86
3,398
fuzzylite/jfuzzylite
jfuzzylite/src/main/java/com/fuzzylite/factory/CloningFactory.java
CloningFactory.cloneObject
@SuppressWarnings("unchecked") public T cloneObject(String key) { if (this.objects.containsKey(key)) { T object = this.objects.get(key); if (object != null) { try { return (T) object.clone(); } catch (Exception ex) { ...
java
@SuppressWarnings("unchecked") public T cloneObject(String key) { if (this.objects.containsKey(key)) { T object = this.objects.get(key); if (object != null) { try { return (T) object.clone(); } catch (Exception ex) { ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "T", "cloneObject", "(", "String", "key", ")", "{", "if", "(", "this", ".", "objects", ".", "containsKey", "(", "key", ")", ")", "{", "T", "object", "=", "this", ".", "objects", ".", "get", ...
Creates a cloned object by executing the clone method on the registered object @param key is the unique name by which objects are registered @return a cloned object by executing the clone method on the registered object
[ "Creates", "a", "cloned", "object", "by", "executing", "the", "clone", "method", "on", "the", "registered", "object" ]
583ac1928f39512af75de80d560e67448039595a
https://github.com/fuzzylite/jfuzzylite/blob/583ac1928f39512af75de80d560e67448039595a/jfuzzylite/src/main/java/com/fuzzylite/factory/CloningFactory.java#L96-L111
3,399
fuzzylite/jfuzzylite
jfuzzylite/src/main/java/com/fuzzylite/Engine.java
Engine.configure
public void configure(String conjunction, String disjunction, String implication, String aggregation, String defuzzifier, String activation) { TNormFactory tnormFactory = FactoryManager.instance().tnorm(); SNormFactory snormFactory = FactoryManager.instance().snorm(); TN...
java
public void configure(String conjunction, String disjunction, String implication, String aggregation, String defuzzifier, String activation) { TNormFactory tnormFactory = FactoryManager.instance().tnorm(); SNormFactory snormFactory = FactoryManager.instance().snorm(); TN...
[ "public", "void", "configure", "(", "String", "conjunction", ",", "String", "disjunction", ",", "String", "implication", ",", "String", "aggregation", ",", "String", "defuzzifier", ",", "String", "activation", ")", "{", "TNormFactory", "tnormFactory", "=", "Factor...
Configures the engine with the given operators @param conjunction is a TNorm registered in the TNormFactory @param disjunction is an SNorm registered in the SNormFactory @param implication is an TNorm registered in the TNormFactory @param aggregation is an SNorm registered in the SNormFactory @param defuzzifier is a d...
[ "Configures", "the", "engine", "with", "the", "given", "operators" ]
583ac1928f39512af75de80d560e67448039595a
https://github.com/fuzzylite/jfuzzylite/blob/583ac1928f39512af75de80d560e67448039595a/jfuzzylite/src/main/java/com/fuzzylite/Engine.java#L124-L139