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 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/widget/DragContext.java | DragContext.drawNodeWithTransforms | public void drawNodeWithTransforms(final Context2D context)
{
context.save();
context.transform(m_ltog);
m_prim.drawWithTransforms(context, getNodeParentsAlpha(m_prim.asNode()), null);
context.restore();
} | java | public void drawNodeWithTransforms(final Context2D context)
{
context.save();
context.transform(m_ltog);
m_prim.drawWithTransforms(context, getNodeParentsAlpha(m_prim.asNode()), null);
context.restore();
} | [
"public",
"void",
"drawNodeWithTransforms",
"(",
"final",
"Context2D",
"context",
")",
"{",
"context",
".",
"save",
"(",
")",
";",
"context",
".",
"transform",
"(",
"m_ltog",
")",
";",
"m_prim",
".",
"drawWithTransforms",
"(",
"context",
",",
"getNodeParentsAl... | Draws the node during a drag operation.
Used internally.
@param context | [
"Draws",
"the",
"node",
"during",
"a",
"drag",
"operation",
".",
"Used",
"internally",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/widget/DragContext.java#L135-L144 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/widget/DragContext.java | DragContext.getNodeParentsAlpha | private final double getNodeParentsAlpha(Node<?> node)
{
double alpha = 1;
node = node.getParent();
while (null != node)
{
alpha = alpha * node.getAttributes().getAlpha();
node = node.getParent();
if ((null != node) && (node.getNodeType() == No... | java | private final double getNodeParentsAlpha(Node<?> node)
{
double alpha = 1;
node = node.getParent();
while (null != node)
{
alpha = alpha * node.getAttributes().getAlpha();
node = node.getParent();
if ((null != node) && (node.getNodeType() == No... | [
"private",
"final",
"double",
"getNodeParentsAlpha",
"(",
"Node",
"<",
"?",
">",
"node",
")",
"{",
"double",
"alpha",
"=",
"1",
";",
"node",
"=",
"node",
".",
"getParent",
"(",
")",
";",
"while",
"(",
"null",
"!=",
"node",
")",
"{",
"alpha",
"=",
"... | Returns global alpha value.
@return double | [
"Returns",
"global",
"alpha",
"value",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/widget/DragContext.java#L151-L169 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/widget/DragContext.java | DragContext.dragUpdate | public void dragUpdate(final INodeXYEvent event)
{
m_evtx = event.getX();
m_evty = event.getY();
m_dstx = m_evtx - m_begx;
m_dsty = m_evty - m_begy;
final Point2D p2 = new Point2D(0, 0);
m_gtol.transform(new Point2D(m_dstx, m_dsty), p2);
m_lclp.setX(p2.g... | java | public void dragUpdate(final INodeXYEvent event)
{
m_evtx = event.getX();
m_evty = event.getY();
m_dstx = m_evtx - m_begx;
m_dsty = m_evty - m_begy;
final Point2D p2 = new Point2D(0, 0);
m_gtol.transform(new Point2D(m_dstx, m_dsty), p2);
m_lclp.setX(p2.g... | [
"public",
"void",
"dragUpdate",
"(",
"final",
"INodeXYEvent",
"event",
")",
"{",
"m_evtx",
"=",
"event",
".",
"getX",
"(",
")",
";",
"m_evty",
"=",
"event",
".",
"getY",
"(",
")",
";",
"m_dstx",
"=",
"m_evtx",
"-",
"m_begx",
";",
"m_dsty",
"=",
"m_ev... | Updates the context for the specified Drag Move event.
Used internally.
@param event Drag Move event | [
"Updates",
"the",
"context",
"for",
"the",
"specified",
"Drag",
"Move",
"event",
".",
"Used",
"internally",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/widget/DragContext.java#L177-L202 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Rectangle.java | Rectangle.prepare | @Override
protected boolean prepare(final Context2D context, final Attributes attr, final double alpha)
{
final double w = attr.getWidth();
final double h = attr.getHeight();
final double r = attr.getCornerRadius();
if ((w > 0) && (h > 0))
{
context.beginPa... | java | @Override
protected boolean prepare(final Context2D context, final Attributes attr, final double alpha)
{
final double w = attr.getWidth();
final double h = attr.getHeight();
final double r = attr.getCornerRadius();
if ((w > 0) && (h > 0))
{
context.beginPa... | [
"@",
"Override",
"protected",
"boolean",
"prepare",
"(",
"final",
"Context2D",
"context",
",",
"final",
"Attributes",
"attr",
",",
"final",
"double",
"alpha",
")",
"{",
"final",
"double",
"w",
"=",
"attr",
".",
"getWidth",
"(",
")",
";",
"final",
"double",... | Draws this rectangle.
@param context | [
"Draws",
"this",
"rectangle",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Rectangle.java#L78-L120 | train |
fabric8io/fabric8-forge | addons/camel-tooling-util/src/main/java/io/fabric8/camel/tooling/util/RouteXml.java | RouteXml.marshal | public void marshal(File file, final List<RouteDefinition> routeDefinitionList) throws Exception {
marshal(file, new Model2Model() {
@Override
public XmlModel transform(XmlModel model) {
copyRoutesToElement(routeDefinitionList, model.getContextElement());
... | java | public void marshal(File file, final List<RouteDefinition> routeDefinitionList) throws Exception {
marshal(file, new Model2Model() {
@Override
public XmlModel transform(XmlModel model) {
copyRoutesToElement(routeDefinitionList, model.getContextElement());
... | [
"public",
"void",
"marshal",
"(",
"File",
"file",
",",
"final",
"List",
"<",
"RouteDefinition",
">",
"routeDefinitionList",
")",
"throws",
"Exception",
"{",
"marshal",
"(",
"file",
",",
"new",
"Model2Model",
"(",
")",
"{",
"@",
"Override",
"public",
"XmlMode... | Loads the given file then updates the route definitions from the given list then stores the file again | [
"Loads",
"the",
"given",
"file",
"then",
"updates",
"the",
"route",
"definitions",
"from",
"the",
"given",
"list",
"then",
"stores",
"the",
"file",
"again"
] | a59871bae4d5c5d3ece10f1e8758e73663087f19 | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel-tooling-util/src/main/java/io/fabric8/camel/tooling/util/RouteXml.java#L318-L326 | train |
fabric8io/fabric8-forge | addons/camel-tooling-util/src/main/java/io/fabric8/camel/tooling/util/RouteXml.java | RouteXml.marshalToDoc | public void marshalToDoc(XmlModel model) throws JAXBException {
Marshaller marshaller = jaxbContext().createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, java.lang.Boolean.TRUE);
try {
marshaller.setProperty("com.sun.xml.bind.indentString", " ");
} c... | java | public void marshalToDoc(XmlModel model) throws JAXBException {
Marshaller marshaller = jaxbContext().createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, java.lang.Boolean.TRUE);
try {
marshaller.setProperty("com.sun.xml.bind.indentString", " ");
} c... | [
"public",
"void",
"marshalToDoc",
"(",
"XmlModel",
"model",
")",
"throws",
"JAXBException",
"{",
"Marshaller",
"marshaller",
"=",
"jaxbContext",
"(",
")",
".",
"createMarshaller",
"(",
")",
";",
"marshaller",
".",
"setProperty",
"(",
"Marshaller",
".",
"JAXB_FOR... | Marshals the model to XML and updates the model's doc property to contain the
new marshalled model
@param model | [
"Marshals",
"the",
"model",
"to",
"XML",
"and",
"updates",
"the",
"model",
"s",
"doc",
"property",
"to",
"contain",
"the",
"new",
"marshalled",
"model"
] | a59871bae4d5c5d3ece10f1e8758e73663087f19 | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel-tooling-util/src/main/java/io/fabric8/camel/tooling/util/RouteXml.java#L378-L422 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/json/validators/ColorValidator.java | ColorValidator.isSpecialColorName | public static boolean isSpecialColorName(final String colorName)
{
for (final String name : SPECIAL_COLOR_NAMES)
{
if (name.equalsIgnoreCase(colorName))
{
return true;
}
}
return false;
} | java | public static boolean isSpecialColorName(final String colorName)
{
for (final String name : SPECIAL_COLOR_NAMES)
{
if (name.equalsIgnoreCase(colorName))
{
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"isSpecialColorName",
"(",
"final",
"String",
"colorName",
")",
"{",
"for",
"(",
"final",
"String",
"name",
":",
"SPECIAL_COLOR_NAMES",
")",
"{",
"if",
"(",
"name",
".",
"equalsIgnoreCase",
"(",
"colorName",
")",
")",
"{",
"ret... | The test is case-sensitive. It assumes the value was already converted to lower-case.
@param colorName
@return Whether the colorName is one of the "special" color names that are allowed as color values,
but are not actually colors, i.e. "transparent", "inherit" or "currentcolor". | [
"The",
"test",
"is",
"case",
"-",
"sensitive",
".",
"It",
"assumes",
"the",
"value",
"was",
"already",
"converted",
"to",
"lower",
"-",
"case",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/json/validators/ColorValidator.java#L138-L148 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/GroupOf.java | GroupOf.setLocation | @Override
public C setLocation(final Point2D p)
{
setX(p.getX());
setY(p.getY());
return cast();
} | java | @Override
public C setLocation(final Point2D p)
{
setX(p.getX());
setY(p.getY());
return cast();
} | [
"@",
"Override",
"public",
"C",
"setLocation",
"(",
"final",
"Point2D",
"p",
")",
"{",
"setX",
"(",
"p",
".",
"getX",
"(",
")",
")",
";",
"setY",
"(",
"p",
".",
"getY",
"(",
")",
")",
";",
"return",
"cast",
"(",
")",
";",
"}"
] | Sets the X and Y attributes to P.x and P.y
@param p Point2D
@return Group this Group | [
"Sets",
"the",
"X",
"and",
"Y",
"attributes",
"to",
"P",
".",
"x",
"and",
"P",
".",
"y"
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/GroupOf.java#L220-L228 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/GroupOf.java | GroupOf.setScale | @Override
public C setScale(final double x, final double y)
{
getAttributes().setScale(x, y);
return cast();
} | java | @Override
public C setScale(final double x, final double y)
{
getAttributes().setScale(x, y);
return cast();
} | [
"@",
"Override",
"public",
"C",
"setScale",
"(",
"final",
"double",
"x",
",",
"final",
"double",
"y",
")",
"{",
"getAttributes",
"(",
")",
".",
"setScale",
"(",
"x",
",",
"y",
")",
";",
"return",
"cast",
"(",
")",
";",
"}"
] | Sets this gruop's scale, starting at the given x and y
@param x
@param y
@return Group this Group | [
"Sets",
"this",
"gruop",
"s",
"scale",
"starting",
"at",
"the",
"given",
"x",
"and",
"y"
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/GroupOf.java#L401-L407 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/GroupOf.java | GroupOf.setShear | @Override
public C setShear(final double x, final double y)
{
getAttributes().setShear(x, y);
return cast();
} | java | @Override
public C setShear(final double x, final double y)
{
getAttributes().setShear(x, y);
return cast();
} | [
"@",
"Override",
"public",
"C",
"setShear",
"(",
"final",
"double",
"x",
",",
"final",
"double",
"y",
")",
"{",
"getAttributes",
"(",
")",
".",
"setShear",
"(",
"x",
",",
"y",
")",
";",
"return",
"cast",
"(",
")",
";",
"}"
] | Sets this group's shear
@param offset
@return T | [
"Sets",
"this",
"group",
"s",
"shear"
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/GroupOf.java#L501-L507 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/GroupOf.java | GroupOf.setOffset | @Override
public C setOffset(final double x, final double y)
{
getAttributes().setOffset(x, y);
return cast();
} | java | @Override
public C setOffset(final double x, final double y)
{
getAttributes().setOffset(x, y);
return cast();
} | [
"@",
"Override",
"public",
"C",
"setOffset",
"(",
"final",
"double",
"x",
",",
"final",
"double",
"y",
")",
"{",
"getAttributes",
"(",
")",
".",
"setOffset",
"(",
"x",
",",
"y",
")",
";",
"return",
"cast",
"(",
")",
";",
"}"
] | Sets this group's offset, at the given x and y coordinates.
@param x
@param y
@return Group this Group | [
"Sets",
"this",
"group",
"s",
"offset",
"at",
"the",
"given",
"x",
"and",
"y",
"coordinates",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/GroupOf.java#L544-L550 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/GroupOf.java | GroupOf.attachToLayerColorMap | @Override
public void attachToLayerColorMap()
{
final Layer layer = getLayer();
if (null != layer)
{
final NFastArrayList<T> list = getChildNodes();
if (null != list)
{
final int size = list.size();
for (int i = 0; i ... | java | @Override
public void attachToLayerColorMap()
{
final Layer layer = getLayer();
if (null != layer)
{
final NFastArrayList<T> list = getChildNodes();
if (null != list)
{
final int size = list.size();
for (int i = 0; i ... | [
"@",
"Override",
"public",
"void",
"attachToLayerColorMap",
"(",
")",
"{",
"final",
"Layer",
"layer",
"=",
"getLayer",
"(",
")",
";",
"if",
"(",
"null",
"!=",
"layer",
")",
"{",
"final",
"NFastArrayList",
"<",
"T",
">",
"list",
"=",
"getChildNodes",
"(",... | Attaches all primitives to the Layers Color Map | [
"Attaches",
"all",
"primitives",
"to",
"the",
"Layers",
"Color",
"Map"
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/GroupOf.java#L751-L770 | train |
fabric8io/fabric8-forge | addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/ConfigureEndpointPropertiesStep.java | ConfigureEndpointPropertiesStep.insertEndpointBefore | private Node insertEndpointBefore(Node camel) {
// if there is endpoints then the cut-off is after the last
Node endpoint = null;
for (int i = 0; i < camel.getChildNodes().getLength(); i++) {
Node found = camel.getChildNodes().item(i);
String name = found.getNodeName();
... | java | private Node insertEndpointBefore(Node camel) {
// if there is endpoints then the cut-off is after the last
Node endpoint = null;
for (int i = 0; i < camel.getChildNodes().getLength(); i++) {
Node found = camel.getChildNodes().item(i);
String name = found.getNodeName();
... | [
"private",
"Node",
"insertEndpointBefore",
"(",
"Node",
"camel",
")",
"{",
"// if there is endpoints then the cut-off is after the last",
"Node",
"endpoint",
"=",
"null",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"camel",
".",
"getChildNodes",
"(",
"... | To find the closet node that we need to insert the endpoints before, so the Camel schema is valid. | [
"To",
"find",
"the",
"closet",
"node",
"that",
"we",
"need",
"to",
"insert",
"the",
"endpoints",
"before",
"so",
"the",
"Camel",
"schema",
"is",
"valid",
"."
] | a59871bae4d5c5d3ece10f1e8758e73663087f19 | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/ConfigureEndpointPropertiesStep.java#L848-L880 | train |
fabric8io/fabric8-forge | addons/utils/src/main/java/io/fabric8/forge/addon/utils/XmlHelper.java | XmlHelper.documentToPrettyInputStream | public static InputStream documentToPrettyInputStream(Node document) throws Exception {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
Source xmlSource = new DOMSource(document);
Result outputTarget = new StreamResult(outputStream);
Transformer transformer = Transform... | java | public static InputStream documentToPrettyInputStream(Node document) throws Exception {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
Source xmlSource = new DOMSource(document);
Result outputTarget = new StreamResult(outputStream);
Transformer transformer = Transform... | [
"public",
"static",
"InputStream",
"documentToPrettyInputStream",
"(",
"Node",
"document",
")",
"throws",
"Exception",
"{",
"ByteArrayOutputStream",
"outputStream",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"Source",
"xmlSource",
"=",
"new",
"DOMSource",
"("... | To output a DOM as a stream. | [
"To",
"output",
"a",
"DOM",
"as",
"a",
"stream",
"."
] | a59871bae4d5c5d3ece10f1e8758e73663087f19 | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/utils/src/main/java/io/fabric8/forge/addon/utils/XmlHelper.java#L39-L51 | train |
fabric8io/fabric8-forge | addons/utils/src/main/java/io/fabric8/forge/addon/utils/XmlHelper.java | XmlHelper.nodeToString | public static String nodeToString(Node document) throws Exception {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
Source xmlSource = new DOMSource(document);
Result outputTarget = new StreamResult(outputStream);
Transformer transformer = TransformerFactory.newInstanc... | java | public static String nodeToString(Node document) throws Exception {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
Source xmlSource = new DOMSource(document);
Result outputTarget = new StreamResult(outputStream);
Transformer transformer = TransformerFactory.newInstanc... | [
"public",
"static",
"String",
"nodeToString",
"(",
"Node",
"document",
")",
"throws",
"Exception",
"{",
"ByteArrayOutputStream",
"outputStream",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"Source",
"xmlSource",
"=",
"new",
"DOMSource",
"(",
"document",
")... | To output a Node as a String. | [
"To",
"output",
"a",
"Node",
"as",
"a",
"String",
"."
] | a59871bae4d5c5d3ece10f1e8758e73663087f19 | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/utils/src/main/java/io/fabric8/forge/addon/utils/XmlHelper.java#L74-L83 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Line.java | Line.prepare | @Override
protected boolean prepare(final Context2D context, final Attributes attr, final double alpha)
{
final Point2DArray list = attr.getPoints();
if ((null != list) && (list.size() == 2))
{
if (attr.isDefined(Attribute.DASH_ARRAY))
{
if (false... | java | @Override
protected boolean prepare(final Context2D context, final Attributes attr, final double alpha)
{
final Point2DArray list = attr.getPoints();
if ((null != list) && (list.size() == 2))
{
if (attr.isDefined(Attribute.DASH_ARRAY))
{
if (false... | [
"@",
"Override",
"protected",
"boolean",
"prepare",
"(",
"final",
"Context2D",
"context",
",",
"final",
"Attributes",
"attr",
",",
"final",
"double",
"alpha",
")",
"{",
"final",
"Point2DArray",
"list",
"=",
"attr",
".",
"getPoints",
"(",
")",
";",
"if",
"(... | Draws this line
@param context | [
"Draws",
"this",
"line"
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Line.java#L93-L142 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Line.java | Line.drawDashedLine | protected void drawDashedLine(final Context2D context, double x, double y, final double x2, final double y2, final double[] da, final double plus)
{
final int dashCount = da.length;
final double dx = (x2 - x);
final double dy = (y2 - y);
final boolean xbig = (Math.abs(dx) > Math.a... | java | protected void drawDashedLine(final Context2D context, double x, double y, final double x2, final double y2, final double[] da, final double plus)
{
final int dashCount = da.length;
final double dx = (x2 - x);
final double dy = (y2 - y);
final boolean xbig = (Math.abs(dx) > Math.a... | [
"protected",
"void",
"drawDashedLine",
"(",
"final",
"Context2D",
"context",
",",
"double",
"x",
",",
"double",
"y",
",",
"final",
"double",
"x2",
",",
"final",
"double",
"y2",
",",
"final",
"double",
"[",
"]",
"da",
",",
"final",
"double",
"plus",
")",
... | Draws a dashed line instead of a solid one for the shape.
@param context
@param x
@param y
@param x2
@param y2
@param da
@param state
@param plus | [
"Draws",
"a",
"dashed",
"line",
"instead",
"of",
"a",
"solid",
"one",
"for",
"the",
"shape",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Line.java#L231-L287 | train |
fabric8io/fabric8-forge | fabric8-forge-core/src/main/java/io/fabric8/forge/rest/dto/UICommands.java | UICommands.convertValueToSafeJson | public static Object convertValueToSafeJson(Converter converter, Object value) {
value = Proxies.unwrap(value);
if (isJsonObject(value)) {
return value;
}
if (converter != null) {
// TODO converters ususally go from String -> CustomType?
try {
... | java | public static Object convertValueToSafeJson(Converter converter, Object value) {
value = Proxies.unwrap(value);
if (isJsonObject(value)) {
return value;
}
if (converter != null) {
// TODO converters ususally go from String -> CustomType?
try {
... | [
"public",
"static",
"Object",
"convertValueToSafeJson",
"(",
"Converter",
"converter",
",",
"Object",
"value",
")",
"{",
"value",
"=",
"Proxies",
".",
"unwrap",
"(",
"value",
")",
";",
"if",
"(",
"isJsonObject",
"(",
"value",
")",
")",
"{",
"return",
"valu... | Uses the given converter to convert to a nicer UI value and return the JSON safe version | [
"Uses",
"the",
"given",
"converter",
"to",
"convert",
"to",
"a",
"nicer",
"UI",
"value",
"and",
"return",
"the",
"JSON",
"safe",
"version"
] | a59871bae4d5c5d3ece10f1e8758e73663087f19 | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/fabric8-forge-core/src/main/java/io/fabric8/forge/rest/dto/UICommands.java#L166-L187 | train |
fabric8io/fabric8-forge | fabric8-forge-core/src/main/java/io/fabric8/forge/rest/dto/UICommands.java | UICommands.toSafeJsonValue | protected static Object toSafeJsonValue(Object value) {
if (value == null) {
return null;
} else {
if (value instanceof Boolean || value instanceof String || value instanceof Number) {
return value;
}
if (value instanceof Iterable) {
... | java | protected static Object toSafeJsonValue(Object value) {
if (value == null) {
return null;
} else {
if (value instanceof Boolean || value instanceof String || value instanceof Number) {
return value;
}
if (value instanceof Iterable) {
... | [
"protected",
"static",
"Object",
"toSafeJsonValue",
"(",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"if",
"(",
"value",
"instanceof",
"Boolean",
"||",
"value",
"instanceof",
"String",
... | Lets return a safe JSON value | [
"Lets",
"return",
"a",
"safe",
"JSON",
"value"
] | a59871bae4d5c5d3ece10f1e8758e73663087f19 | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/fabric8-forge-core/src/main/java/io/fabric8/forge/rest/dto/UICommands.java#L192-L250 | train |
mqlight/java-mqlight | mqlight/src/main/java/com/ibm/mqlight/api/impl/logging/Javacore.java | Javacore.generateJavaCore | public static String generateJavaCore() throws Throwable {
final String filePath;
if (javaDumpMethod != null) {
// If javaDumpMethod has been assigned a value then the JVM
// appears to have the appropriate IBM Java classes to take
// a java core.
filePath = takeJavaCore();
} else {
... | java | public static String generateJavaCore() throws Throwable {
final String filePath;
if (javaDumpMethod != null) {
// If javaDumpMethod has been assigned a value then the JVM
// appears to have the appropriate IBM Java classes to take
// a java core.
filePath = takeJavaCore();
} else {
... | [
"public",
"static",
"String",
"generateJavaCore",
"(",
")",
"throws",
"Throwable",
"{",
"final",
"String",
"filePath",
";",
"if",
"(",
"javaDumpMethod",
"!=",
"null",
")",
"{",
"// If javaDumpMethod has been assigned a value then the JVM",
"// appears to have the appropriat... | Public method that allows the caller to ask that a javacore be generated.
@return The file path for the generated java core file.
@throws Throwable | [
"Public",
"method",
"that",
"allows",
"the",
"caller",
"to",
"ask",
"that",
"a",
"javacore",
"be",
"generated",
"."
] | a565dfa6044050826d1221697da9e3268b557aeb | https://github.com/mqlight/java-mqlight/blob/a565dfa6044050826d1221697da9e3268b557aeb/mqlight/src/main/java/com/ibm/mqlight/api/impl/logging/Javacore.java#L88-L102 | train |
mqlight/java-mqlight | mqlight/src/main/java/com/ibm/mqlight/api/impl/logging/Javacore.java | Javacore.takeJavaCore | private static String takeJavaCore() throws Throwable {
logger.entry("takeJavaCore");
String filePath;
try {
javaDumpMethod.invoke(null);
File javacoreFile = getLatestJavacoreFile();
filePath = javacoreFile.getAbsolutePath();
} catch (final InvocationTargetException invocationExcept... | java | private static String takeJavaCore() throws Throwable {
logger.entry("takeJavaCore");
String filePath;
try {
javaDumpMethod.invoke(null);
File javacoreFile = getLatestJavacoreFile();
filePath = javacoreFile.getAbsolutePath();
} catch (final InvocationTargetException invocationExcept... | [
"private",
"static",
"String",
"takeJavaCore",
"(",
")",
"throws",
"Throwable",
"{",
"logger",
".",
"entry",
"(",
"\"takeJavaCore\"",
")",
";",
"String",
"filePath",
";",
"try",
"{",
"javaDumpMethod",
".",
"invoke",
"(",
"null",
")",
";",
"File",
"javacoreFi... | Causes an JVM with the IBM com.ibm.jvm.Dump class present to take a java core.
@return The file path for the generated java core file.
@throws Throwable | [
"Causes",
"an",
"JVM",
"with",
"the",
"IBM",
"com",
".",
"ibm",
".",
"jvm",
".",
"Dump",
"class",
"present",
"to",
"take",
"a",
"java",
"core",
"."
] | a565dfa6044050826d1221697da9e3268b557aeb | https://github.com/mqlight/java-mqlight/blob/a565dfa6044050826d1221697da9e3268b557aeb/mqlight/src/main/java/com/ibm/mqlight/api/impl/logging/Javacore.java#L110-L127 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/types/Point2D.java | Point2D.distance | public static final double distance(final Point2D a, final Point2D b)
{
return Point2DJSO.distance(a.getJSO(), b.getJSO());
} | java | public static final double distance(final Point2D a, final Point2D b)
{
return Point2DJSO.distance(a.getJSO(), b.getJSO());
} | [
"public",
"static",
"final",
"double",
"distance",
"(",
"final",
"Point2D",
"a",
",",
"final",
"Point2D",
"b",
")",
"{",
"return",
"Point2DJSO",
".",
"distance",
"(",
"a",
".",
"getJSO",
"(",
")",
",",
"b",
".",
"getJSO",
"(",
")",
")",
";",
"}"
] | Returns the distance from point A to point B.
@param a Point2D
@param b Point2D
@return double | [
"Returns",
"the",
"distance",
"from",
"point",
"A",
"to",
"point",
"B",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/types/Point2D.java#L154-L157 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/types/Point2D.java | Point2D.collinear | public static final boolean collinear(final Point2D p1, final Point2D p2, final Point2D p3)
{
return Geometry.collinear(p1, p2, p3);
} | java | public static final boolean collinear(final Point2D p1, final Point2D p2, final Point2D p3)
{
return Geometry.collinear(p1, p2, p3);
} | [
"public",
"static",
"final",
"boolean",
"collinear",
"(",
"final",
"Point2D",
"p1",
",",
"final",
"Point2D",
"p2",
",",
"final",
"Point2D",
"p3",
")",
"{",
"return",
"Geometry",
".",
"collinear",
"(",
"p1",
",",
"p2",
",",
"p3",
")",
";",
"}"
] | Returns whether the 3 points are colinear, i.e. whether they lie on a single straight line.
@param p1
@param p2
@param p3
@return
@see <a href="http://mathworld.wolfram.com/Collinear.html">Collinear in Wolfram MathWorld</a> | [
"Returns",
"whether",
"the",
"3",
"points",
"are",
"colinear",
"i",
".",
"e",
".",
"whether",
"they",
"lie",
"on",
"a",
"single",
"straight",
"line",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/types/Point2D.java#L411-L414 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/types/Point2D.java | Point2D.polar | public static final Point2D polar(final double radius, final double angle)
{
return new Point2D(radius * Math.cos(angle), radius * Math.sin(angle));
} | java | public static final Point2D polar(final double radius, final double angle)
{
return new Point2D(radius * Math.cos(angle), radius * Math.sin(angle));
} | [
"public",
"static",
"final",
"Point2D",
"polar",
"(",
"final",
"double",
"radius",
",",
"final",
"double",
"angle",
")",
"{",
"return",
"new",
"Point2D",
"(",
"radius",
"*",
"Math",
".",
"cos",
"(",
"angle",
")",
",",
"radius",
"*",
"Math",
".",
"sin",... | Construct a Point2D from polar coordinates, i.e. a radius and an angle.
@param radius
@param angle in radians
@return Point2D | [
"Construct",
"a",
"Point2D",
"from",
"polar",
"coordinates",
"i",
".",
"e",
".",
"a",
"radius",
"and",
"an",
"angle",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/types/Point2D.java#L453-L456 | train |
fabric8io/fabric8-forge | addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelXmlHelper.java | CamelXmlHelper.dumpModelAsXml | public static String dumpModelAsXml(Object definition, ClassLoader classLoader, boolean includeEndTag, int indent) throws JAXBException, XMLStreamException {
JAXBContext jaxbContext = JAXBContext.newInstance(JAXB_CONTEXT_PACKAGES, classLoader);
StringWriter buffer = new StringWriter();
// we d... | java | public static String dumpModelAsXml(Object definition, ClassLoader classLoader, boolean includeEndTag, int indent) throws JAXBException, XMLStreamException {
JAXBContext jaxbContext = JAXBContext.newInstance(JAXB_CONTEXT_PACKAGES, classLoader);
StringWriter buffer = new StringWriter();
// we d... | [
"public",
"static",
"String",
"dumpModelAsXml",
"(",
"Object",
"definition",
",",
"ClassLoader",
"classLoader",
",",
"boolean",
"includeEndTag",
",",
"int",
"indent",
")",
"throws",
"JAXBException",
",",
"XMLStreamException",
"{",
"JAXBContext",
"jaxbContext",
"=",
... | Dumps the definition as XML
@param definition the definition, such as a {@link org.apache.camel.NamedNode}
@param classLoader the class loader
@return the output in XML (is formatted)
@throws JAXBException is throw if error marshalling to XML | [
"Dumps",
"the",
"definition",
"as",
"XML"
] | a59871bae4d5c5d3ece10f1e8758e73663087f19 | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelXmlHelper.java#L434-L475 | train |
fabric8io/fabric8-forge | addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelXmlHelper.java | CamelXmlHelper.collapseNode | private static String collapseNode(String xml, String name) {
String answer = xml;
Pattern pattern = Pattern.compile("<" + name + "(.*)></" + name + ">");
Matcher matcher = pattern.matcher(answer);
if (matcher.find()) {
answer = matcher.replaceAll("<" + name + "$1/>");
... | java | private static String collapseNode(String xml, String name) {
String answer = xml;
Pattern pattern = Pattern.compile("<" + name + "(.*)></" + name + ">");
Matcher matcher = pattern.matcher(answer);
if (matcher.find()) {
answer = matcher.replaceAll("<" + name + "$1/>");
... | [
"private",
"static",
"String",
"collapseNode",
"(",
"String",
"xml",
",",
"String",
"name",
")",
"{",
"String",
"answer",
"=",
"xml",
";",
"Pattern",
"pattern",
"=",
"Pattern",
".",
"compile",
"(",
"\"<\"",
"+",
"name",
"+",
"\"(.*)></\"",
"+",
"name",
"... | Collapses all the named node in the XML
@param xml the XML
@param name the name of the node
@return the XML with collapsed nodes | [
"Collapses",
"all",
"the",
"named",
"node",
"in",
"the",
"XML"
] | a59871bae4d5c5d3ece10f1e8758e73663087f19 | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelXmlHelper.java#L484-L493 | train |
fabric8io/fabric8-forge | addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelXmlHelper.java | CamelXmlHelper.xmlAsModel | public static Object xmlAsModel(Node node, ClassLoader classLoader) throws JAXBException {
JAXBContext jaxbContext = JAXBContext.newInstance(JAXB_CONTEXT_PACKAGES, classLoader);
Unmarshaller marshaller = jaxbContext.createUnmarshaller();
Object answer = marshaller.unmarshal(node);
retu... | java | public static Object xmlAsModel(Node node, ClassLoader classLoader) throws JAXBException {
JAXBContext jaxbContext = JAXBContext.newInstance(JAXB_CONTEXT_PACKAGES, classLoader);
Unmarshaller marshaller = jaxbContext.createUnmarshaller();
Object answer = marshaller.unmarshal(node);
retu... | [
"public",
"static",
"Object",
"xmlAsModel",
"(",
"Node",
"node",
",",
"ClassLoader",
"classLoader",
")",
"throws",
"JAXBException",
"{",
"JAXBContext",
"jaxbContext",
"=",
"JAXBContext",
".",
"newInstance",
"(",
"JAXB_CONTEXT_PACKAGES",
",",
"classLoader",
")",
";",... | Turns the xml into EIP model classes
@param node the node representing the XML
@param classLoader the class loader
@return the EIP model class
@throws JAXBException is throw if error unmarshalling XML to Object | [
"Turns",
"the",
"xml",
"into",
"EIP",
"model",
"classes"
] | a59871bae4d5c5d3ece10f1e8758e73663087f19 | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelXmlHelper.java#L503-L510 | train |
mqlight/java-mqlight | mqlight/src/main/java/com/ibm/mqlight/api/security/KeyStoreUtils.java | KeyStoreUtils.addPrivateKey | public static void addPrivateKey(KeyStore keyStore, File pemKeyFile, char[] passwordChars, List<Certificate> certChain) throws IOException, GeneralSecurityException {
final String methodName = "addPrivateKey";
logger.entry(methodName, pemKeyFile, certChain);
PrivateKey privateKey = createPrivat... | java | public static void addPrivateKey(KeyStore keyStore, File pemKeyFile, char[] passwordChars, List<Certificate> certChain) throws IOException, GeneralSecurityException {
final String methodName = "addPrivateKey";
logger.entry(methodName, pemKeyFile, certChain);
PrivateKey privateKey = createPrivat... | [
"public",
"static",
"void",
"addPrivateKey",
"(",
"KeyStore",
"keyStore",
",",
"File",
"pemKeyFile",
",",
"char",
"[",
"]",
"passwordChars",
",",
"List",
"<",
"Certificate",
">",
"certChain",
")",
"throws",
"IOException",
",",
"GeneralSecurityException",
"{",
"f... | Adds a private key to the specified key store from the passed private key file and certificate chain.
@param keyStore
The key store to receive the private key.
@param pemKeyFile
A PEM format file containing the private key.
@param passwordChars
The password that protects the private key.
@param certChain The certifica... | [
"Adds",
"a",
"private",
"key",
"to",
"the",
"specified",
"key",
"store",
"from",
"the",
"passed",
"private",
"key",
"file",
"and",
"certificate",
"chain",
"."
] | a565dfa6044050826d1221697da9e3268b557aeb | https://github.com/mqlight/java-mqlight/blob/a565dfa6044050826d1221697da9e3268b557aeb/mqlight/src/main/java/com/ibm/mqlight/api/security/KeyStoreUtils.java#L125-L134 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Scene.java | Scene.fireEvent | @Override
public final void fireEvent(final GwtEvent<?> event)
{
final NFastArrayList<Layer> layers = getChildNodes();
if (null != layers)
{
final int size = layers.size();
for (int i = size - 1; i >= 0; i--)
{
final Layer layer = lay... | java | @Override
public final void fireEvent(final GwtEvent<?> event)
{
final NFastArrayList<Layer> layers = getChildNodes();
if (null != layers)
{
final int size = layers.size();
for (int i = size - 1; i >= 0; i--)
{
final Layer layer = lay... | [
"@",
"Override",
"public",
"final",
"void",
"fireEvent",
"(",
"final",
"GwtEvent",
"<",
"?",
">",
"event",
")",
"{",
"final",
"NFastArrayList",
"<",
"Layer",
">",
"layers",
"=",
"getChildNodes",
"(",
")",
";",
"if",
"(",
"null",
"!=",
"layers",
")",
"{... | Fires the given GWT event. | [
"Fires",
"the",
"given",
"GWT",
"event",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Scene.java#L327-L346 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Scene.java | Scene.moveDown | @Override
public final Scene moveDown(final Layer layer)
{
if ((null != layer) && (LienzoCore.IS_CANVAS_SUPPORTED))
{
final int size = getElement().getChildCount();
if (size < 2)
{
return this;
}
final DivElement elemen... | java | @Override
public final Scene moveDown(final Layer layer)
{
if ((null != layer) && (LienzoCore.IS_CANVAS_SUPPORTED))
{
final int size = getElement().getChildCount();
if (size < 2)
{
return this;
}
final DivElement elemen... | [
"@",
"Override",
"public",
"final",
"Scene",
"moveDown",
"(",
"final",
"Layer",
"layer",
")",
"{",
"if",
"(",
"(",
"null",
"!=",
"layer",
")",
"&&",
"(",
"LienzoCore",
".",
"IS_CANVAS_SUPPORTED",
")",
")",
"{",
"final",
"int",
"size",
"=",
"getElement",
... | Moves the layer one level down in this scene.
@param layer | [
"Moves",
"the",
"layer",
"one",
"level",
"down",
"in",
"this",
"scene",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Scene.java#L494-L532 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Scene.java | Scene.moveUp | @Override
public final Scene moveUp(final Layer layer)
{
if ((null != layer) && (LienzoCore.IS_CANVAS_SUPPORTED))
{
final int size = getElement().getChildCount();
if (size < 2)
{
return this;
}
final DivElement element ... | java | @Override
public final Scene moveUp(final Layer layer)
{
if ((null != layer) && (LienzoCore.IS_CANVAS_SUPPORTED))
{
final int size = getElement().getChildCount();
if (size < 2)
{
return this;
}
final DivElement element ... | [
"@",
"Override",
"public",
"final",
"Scene",
"moveUp",
"(",
"final",
"Layer",
"layer",
")",
"{",
"if",
"(",
"(",
"null",
"!=",
"layer",
")",
"&&",
"(",
"LienzoCore",
".",
"IS_CANVAS_SUPPORTED",
")",
")",
"{",
"final",
"int",
"size",
"=",
"getElement",
... | Moves the layer one level up in this scene.
@param layer | [
"Moves",
"the",
"layer",
"one",
"level",
"up",
"in",
"this",
"scene",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Scene.java#L539-L577 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Scene.java | Scene.moveToTop | @Override
public final Scene moveToTop(final Layer layer)
{
if ((null != layer) && (LienzoCore.IS_CANVAS_SUPPORTED))
{
final int size = getElement().getChildCount();
if (size < 2)
{
return this;
}
final DivElement eleme... | java | @Override
public final Scene moveToTop(final Layer layer)
{
if ((null != layer) && (LienzoCore.IS_CANVAS_SUPPORTED))
{
final int size = getElement().getChildCount();
if (size < 2)
{
return this;
}
final DivElement eleme... | [
"@",
"Override",
"public",
"final",
"Scene",
"moveToTop",
"(",
"final",
"Layer",
"layer",
")",
"{",
"if",
"(",
"(",
"null",
"!=",
"layer",
")",
"&&",
"(",
"LienzoCore",
".",
"IS_CANVAS_SUPPORTED",
")",
")",
"{",
"final",
"int",
"size",
"=",
"getElement",... | Moves the layer to the top of the layers stack in this scene.
@param layer | [
"Moves",
"the",
"layer",
"to",
"the",
"top",
"of",
"the",
"layers",
"stack",
"in",
"this",
"scene",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Scene.java#L584-L609 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/wires/WiresConnector.java | WiresConnector.getMagnetsOnAutoConnection | public WiresMagnet[] getMagnetsOnAutoConnection(final WiresShape headS, final WiresShape tailS)
{
final WiresConnection headC = getHeadConnection();
final WiresConnection tailC = getTailConnection();
if (!(headC.isAutoConnection() || tailC.isAutoConnection()))
{
// at l... | java | public WiresMagnet[] getMagnetsOnAutoConnection(final WiresShape headS, final WiresShape tailS)
{
final WiresConnection headC = getHeadConnection();
final WiresConnection tailC = getTailConnection();
if (!(headC.isAutoConnection() || tailC.isAutoConnection()))
{
// at l... | [
"public",
"WiresMagnet",
"[",
"]",
"getMagnetsOnAutoConnection",
"(",
"final",
"WiresShape",
"headS",
",",
"final",
"WiresShape",
"tailS",
")",
"{",
"final",
"WiresConnection",
"headC",
"=",
"getHeadConnection",
"(",
")",
";",
"final",
"WiresConnection",
"tailC",
... | This is making some assumptions that will have to be fixed for anythign other than 8 Magnets at compass ordinal points.
If there is no shape overlap, and one box is in the corner of the other box, then use nearest corner connections, else use nearest mid connection.
Else there is overlap. This is now much more difficul... | [
"This",
"is",
"making",
"some",
"assumptions",
"that",
"will",
"have",
"to",
"be",
"fixed",
"for",
"anythign",
"other",
"than",
"8",
"Magnets",
"at",
"compass",
"ordinal",
"points",
".",
"If",
"there",
"is",
"no",
"shape",
"overlap",
"and",
"one",
"box",
... | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/wires/WiresConnector.java#L428-L459 | train |
fabric8io/fabric8-forge | addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CollectionHelper.java | CollectionHelper.first | public static <T> T first(Iterable<T> objects) {
if (objects != null) {
for (T object : objects) {
return object;
}
}
return null;
} | java | public static <T> T first(Iterable<T> objects) {
if (objects != null) {
for (T object : objects) {
return object;
}
}
return null;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"first",
"(",
"Iterable",
"<",
"T",
">",
"objects",
")",
"{",
"if",
"(",
"objects",
"!=",
"null",
")",
"{",
"for",
"(",
"T",
"object",
":",
"objects",
")",
"{",
"return",
"object",
";",
"}",
"}",
"return",
... | Returns the first item in the given collection | [
"Returns",
"the",
"first",
"item",
"in",
"the",
"given",
"collection"
] | a59871bae4d5c5d3ece10f1e8758e73663087f19 | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CollectionHelper.java#L26-L33 | train |
fabric8io/fabric8-forge | addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CollectionHelper.java | CollectionHelper.last | public static <T> T last(Iterable<T> objects) {
T answer = null;
if (objects != null) {
for (T object : objects) {
answer = object;
}
}
return answer;
} | java | public static <T> T last(Iterable<T> objects) {
T answer = null;
if (objects != null) {
for (T object : objects) {
answer = object;
}
}
return answer;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"last",
"(",
"Iterable",
"<",
"T",
">",
"objects",
")",
"{",
"T",
"answer",
"=",
"null",
";",
"if",
"(",
"objects",
"!=",
"null",
")",
"{",
"for",
"(",
"T",
"object",
":",
"objects",
")",
"{",
"answer",
"... | Returns the last item in the given collection | [
"Returns",
"the",
"last",
"item",
"in",
"the",
"given",
"collection"
] | a59871bae4d5c5d3ece10f1e8758e73663087f19 | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CollectionHelper.java#L38-L46 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/util/Matrix.java | Matrix.identity | public static Matrix identity(final int N)
{
final Matrix I = new Matrix(N, N);
for (int i = 0; i < N; i++)
{
I.m_data[i][i] = 1;
}
return I;
} | java | public static Matrix identity(final int N)
{
final Matrix I = new Matrix(N, N);
for (int i = 0; i < N; i++)
{
I.m_data[i][i] = 1;
}
return I;
} | [
"public",
"static",
"Matrix",
"identity",
"(",
"final",
"int",
"N",
")",
"{",
"final",
"Matrix",
"I",
"=",
"new",
"Matrix",
"(",
"N",
",",
"N",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"N",
";",
"i",
"++",
")",
"{",
"I",
"... | Creates and returns the N-by-N identity matrix
@param N
@return | [
"Creates",
"and",
"returns",
"the",
"N",
"-",
"by",
"-",
"N",
"identity",
"matrix"
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/util/Matrix.java#L86-L95 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/util/Matrix.java | Matrix.swap | private void swap(final int i, final int j)
{
final double[] temp = m_data[i];
m_data[i] = m_data[j];
m_data[j] = temp;
} | java | private void swap(final int i, final int j)
{
final double[] temp = m_data[i];
m_data[i] = m_data[j];
m_data[j] = temp;
} | [
"private",
"void",
"swap",
"(",
"final",
"int",
"i",
",",
"final",
"int",
"j",
")",
"{",
"final",
"double",
"[",
"]",
"temp",
"=",
"m_data",
"[",
"i",
"]",
";",
"m_data",
"[",
"i",
"]",
"=",
"m_data",
"[",
"j",
"]",
";",
"m_data",
"[",
"j",
"... | Swaps rows i and j
@param i
@param j | [
"Swaps",
"rows",
"i",
"and",
"j"
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/util/Matrix.java#L102-L109 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/util/Matrix.java | Matrix.transpose | public Matrix transpose()
{
final Matrix A = new Matrix(m_columns, m_rows);
for (int i = 0; i < m_rows; i++)
{
for (int j = 0; j < m_columns; j++)
{
A.m_data[j][i] = this.m_data[i][j];
}
}
return A;
} | java | public Matrix transpose()
{
final Matrix A = new Matrix(m_columns, m_rows);
for (int i = 0; i < m_rows; i++)
{
for (int j = 0; j < m_columns; j++)
{
A.m_data[j][i] = this.m_data[i][j];
}
}
return A;
} | [
"public",
"Matrix",
"transpose",
"(",
")",
"{",
"final",
"Matrix",
"A",
"=",
"new",
"Matrix",
"(",
"m_columns",
",",
"m_rows",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"m_rows",
";",
"i",
"++",
")",
"{",
"for",
"(",
"int",
"j"... | Creates and returns the transpose of the matrix
@return | [
"Creates",
"and",
"returns",
"the",
"transpose",
"of",
"the",
"matrix"
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/util/Matrix.java#L115-L127 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/util/Matrix.java | Matrix.plus | public Matrix plus(final Matrix B)
{
final Matrix A = this;
if ((B.m_rows != A.m_rows) || (B.m_columns != A.m_columns))
{
throw new GeometryException("Illegal matrix dimensions");
}
final Matrix C = new Matrix(m_rows, m_columns);
for (int i = 0... | java | public Matrix plus(final Matrix B)
{
final Matrix A = this;
if ((B.m_rows != A.m_rows) || (B.m_columns != A.m_columns))
{
throw new GeometryException("Illegal matrix dimensions");
}
final Matrix C = new Matrix(m_rows, m_columns);
for (int i = 0... | [
"public",
"Matrix",
"plus",
"(",
"final",
"Matrix",
"B",
")",
"{",
"final",
"Matrix",
"A",
"=",
"this",
";",
"if",
"(",
"(",
"B",
".",
"m_rows",
"!=",
"A",
".",
"m_rows",
")",
"||",
"(",
"B",
".",
"m_columns",
"!=",
"A",
".",
"m_columns",
")",
... | Returns C = A + B
@param B
@return new Matrix C
@throws GeometryException if the matrix dimensions don't match | [
"Returns",
"C",
"=",
"A",
"+",
"B"
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/util/Matrix.java#L136-L154 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/util/Matrix.java | Matrix.eq | public boolean eq(final Matrix B)
{
final Matrix A = this;
if ((B.m_rows != A.m_rows) || (B.m_columns != A.m_columns))
{
return false;
}
for (int i = 0; i < m_rows; i++)
{
for (int j = 0; j < m_columns; j++)
{
... | java | public boolean eq(final Matrix B)
{
final Matrix A = this;
if ((B.m_rows != A.m_rows) || (B.m_columns != A.m_columns))
{
return false;
}
for (int i = 0; i < m_rows; i++)
{
for (int j = 0; j < m_columns; j++)
{
... | [
"public",
"boolean",
"eq",
"(",
"final",
"Matrix",
"B",
")",
"{",
"final",
"Matrix",
"A",
"=",
"this",
";",
"if",
"(",
"(",
"B",
".",
"m_rows",
"!=",
"A",
".",
"m_rows",
")",
"||",
"(",
"B",
".",
"m_columns",
"!=",
"A",
".",
"m_columns",
")",
"... | Returns whether the matrix is the same as this matrix.
@param B
@return | [
"Returns",
"whether",
"the",
"matrix",
"is",
"the",
"same",
"as",
"this",
"matrix",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/util/Matrix.java#L189-L208 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/util/Matrix.java | Matrix.solve | public Matrix solve(final Matrix rhs)
{
if ((m_rows != m_columns) || (rhs.m_rows != m_columns) || (rhs.m_columns != 1))
{
throw new GeometryException("Illegal matrix dimensions");
}
// create copies of the data
final Matrix A = new Matrix(this);
... | java | public Matrix solve(final Matrix rhs)
{
if ((m_rows != m_columns) || (rhs.m_rows != m_columns) || (rhs.m_columns != 1))
{
throw new GeometryException("Illegal matrix dimensions");
}
// create copies of the data
final Matrix A = new Matrix(this);
... | [
"public",
"Matrix",
"solve",
"(",
"final",
"Matrix",
"rhs",
")",
"{",
"if",
"(",
"(",
"m_rows",
"!=",
"m_columns",
")",
"||",
"(",
"rhs",
".",
"m_rows",
"!=",
"m_columns",
")",
"||",
"(",
"rhs",
".",
"m_columns",
"!=",
"1",
")",
")",
"{",
"throw",
... | Returns x = A^-1 b, assuming A is square and has full rank
@param rhs
@return Matrix x
@throws GeometryException if the matrix dimensions don't match | [
"Returns",
"x",
"=",
"A^",
"-",
"1",
"b",
"assuming",
"A",
"is",
"square",
"and",
"has",
"full",
"rank"
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/util/Matrix.java#L247-L318 | train |
fabric8io/fabric8-forge | fabric8-forge-maven-plugin/src/main/java/io/fabric8/forge/maven/FabricArchetypeCatalogFactory.java | FabricArchetypeCatalogFactory.getArchetypeCatalog | public static ArchetypeCatalog getArchetypeCatalog(Artifact artifact) throws Exception {
File file = artifact.getFile();
if (file != null) {
URL url = new URL("file", (String) null, file.getAbsolutePath());
URLClassLoader loader = new URLClassLoader(new URL[]{url});
I... | java | public static ArchetypeCatalog getArchetypeCatalog(Artifact artifact) throws Exception {
File file = artifact.getFile();
if (file != null) {
URL url = new URL("file", (String) null, file.getAbsolutePath());
URLClassLoader loader = new URLClassLoader(new URL[]{url});
I... | [
"public",
"static",
"ArchetypeCatalog",
"getArchetypeCatalog",
"(",
"Artifact",
"artifact",
")",
"throws",
"Exception",
"{",
"File",
"file",
"=",
"artifact",
".",
"getFile",
"(",
")",
";",
"if",
"(",
"file",
"!=",
"null",
")",
"{",
"URL",
"url",
"=",
"new"... | Gets the archetype-catalog from the given maven artifact | [
"Gets",
"the",
"archetype",
"-",
"catalog",
"from",
"the",
"given",
"maven",
"artifact"
] | a59871bae4d5c5d3ece10f1e8758e73663087f19 | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/fabric8-forge-maven-plugin/src/main/java/io/fabric8/forge/maven/FabricArchetypeCatalogFactory.java#L32-L43 | train |
fabric8io/fabric8-forge | addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelVersionHelper.java | CamelVersionHelper.isGE | public static boolean isGE(String base, String other) {
ComparableVersion v1 = new ComparableVersion(base);
ComparableVersion v2 = new ComparableVersion(other);
return v2.compareTo(v1) >= 0;
} | java | public static boolean isGE(String base, String other) {
ComparableVersion v1 = new ComparableVersion(base);
ComparableVersion v2 = new ComparableVersion(other);
return v2.compareTo(v1) >= 0;
} | [
"public",
"static",
"boolean",
"isGE",
"(",
"String",
"base",
",",
"String",
"other",
")",
"{",
"ComparableVersion",
"v1",
"=",
"new",
"ComparableVersion",
"(",
"base",
")",
";",
"ComparableVersion",
"v2",
"=",
"new",
"ComparableVersion",
"(",
"other",
")",
... | Checks whether other >= base
@param base the base version
@param other the other version
@return <tt>true</tt> if GE, <tt>false</tt> otherwise | [
"Checks",
"whether",
"other",
">",
"=",
"base"
] | a59871bae4d5c5d3ece10f1e8758e73663087f19 | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelVersionHelper.java#L44-L48 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/widget/LienzoHandlerManager.java | LienzoHandlerManager.doCheckEnterExitShape | @SuppressWarnings("unchecked")
private final Shape<?> doCheckEnterExitShape(final INodeXYEvent event)
{
final int x = event.getX();
final int y = event.getY();
final Shape<?> shape = findShapeAtPoint(x, y);
if (shape != null)
{
final IPrimitive<?> prim = sh... | java | @SuppressWarnings("unchecked")
private final Shape<?> doCheckEnterExitShape(final INodeXYEvent event)
{
final int x = event.getX();
final int y = event.getY();
final Shape<?> shape = findShapeAtPoint(x, y);
if (shape != null)
{
final IPrimitive<?> prim = sh... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"final",
"Shape",
"<",
"?",
">",
"doCheckEnterExitShape",
"(",
"final",
"INodeXYEvent",
"event",
")",
"{",
"final",
"int",
"x",
"=",
"event",
".",
"getX",
"(",
")",
";",
"final",
"int",
"y",
... | This will also return the shape under the cursor, for some optimization on Mouse Move | [
"This",
"will",
"also",
"return",
"the",
"shape",
"under",
"the",
"cursor",
"for",
"some",
"optimization",
"on",
"Mouse",
"Move"
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/widget/LienzoHandlerManager.java#L751-L802 | train |
fabric8io/fabric8-forge | fabric8-forge-core/src/main/java/io/fabric8/forge/rest/main/RepositoryCache.java | RepositoryCache.updateUserRepositories | public void updateUserRepositories(List<RepositoryDTO> repositoryDTOs) {
for (RepositoryDTO repositoryDTO : repositoryDTOs) {
String fullName = repositoryDTO.getFullName();
userCache.put(fullName, repositoryDTO);
}
} | java | public void updateUserRepositories(List<RepositoryDTO> repositoryDTOs) {
for (RepositoryDTO repositoryDTO : repositoryDTOs) {
String fullName = repositoryDTO.getFullName();
userCache.put(fullName, repositoryDTO);
}
} | [
"public",
"void",
"updateUserRepositories",
"(",
"List",
"<",
"RepositoryDTO",
">",
"repositoryDTOs",
")",
"{",
"for",
"(",
"RepositoryDTO",
"repositoryDTO",
":",
"repositoryDTOs",
")",
"{",
"String",
"fullName",
"=",
"repositoryDTO",
".",
"getFullName",
"(",
")",... | Updates the cache of all user repositories | [
"Updates",
"the",
"cache",
"of",
"all",
"user",
"repositories"
] | a59871bae4d5c5d3ece10f1e8758e73663087f19 | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/fabric8-forge-core/src/main/java/io/fabric8/forge/rest/main/RepositoryCache.java#L35-L40 | train |
fabric8io/fabric8-forge | fabric8-forge-core/src/main/java/io/fabric8/forge/rest/main/RepositoryCache.java | RepositoryCache.getOrFindUserRepository | public RepositoryDTO getOrFindUserRepository(String user, String repositoryName, GitRepoClient repoClient) {
RepositoryDTO repository = getUserRepository(user, repositoryName);
if (repository == null) {
List<RepositoryDTO> repositoryDTOs = repoClient.listRepositories();
updateUse... | java | public RepositoryDTO getOrFindUserRepository(String user, String repositoryName, GitRepoClient repoClient) {
RepositoryDTO repository = getUserRepository(user, repositoryName);
if (repository == null) {
List<RepositoryDTO> repositoryDTOs = repoClient.listRepositories();
updateUse... | [
"public",
"RepositoryDTO",
"getOrFindUserRepository",
"(",
"String",
"user",
",",
"String",
"repositoryName",
",",
"GitRepoClient",
"repoClient",
")",
"{",
"RepositoryDTO",
"repository",
"=",
"getUserRepository",
"(",
"user",
",",
"repositoryName",
")",
";",
"if",
"... | Attempts to use the cache or performs a query for all the users repositories if its not present | [
"Attempts",
"to",
"use",
"the",
"cache",
"or",
"performs",
"a",
"query",
"for",
"all",
"the",
"users",
"repositories",
"if",
"its",
"not",
"present"
] | a59871bae4d5c5d3ece10f1e8758e73663087f19 | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/fabric8-forge-core/src/main/java/io/fabric8/forge/rest/main/RepositoryCache.java#L53-L61 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Triangle.java | Triangle.setPoints | public Triangle setPoints(final Point2D a, final Point2D b, final Point2D c)
{
return setPoint2DArray(new Point2DArray(a, b, c));
} | java | public Triangle setPoints(final Point2D a, final Point2D b, final Point2D c)
{
return setPoint2DArray(new Point2DArray(a, b, c));
} | [
"public",
"Triangle",
"setPoints",
"(",
"final",
"Point2D",
"a",
",",
"final",
"Point2D",
"b",
",",
"final",
"Point2D",
"c",
")",
"{",
"return",
"setPoint2DArray",
"(",
"new",
"Point2DArray",
"(",
"a",
",",
"b",
",",
"c",
")",
")",
";",
"}"
] | Sets this triangles points.
@param 3 points {@link Point2D}
@return this Triangle | [
"Sets",
"this",
"triangles",
"points",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Triangle.java#L150-L153 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Arrow.java | Arrow.prepare | @Override
protected boolean prepare(final Context2D context, final Attributes attr, final double alpha)
{
final Point2DArray list = getPolygon();// is null for invalid arrow definition
if ((null != list) && (list.size() > 2))
{
Point2D point = list.get(0);
conte... | java | @Override
protected boolean prepare(final Context2D context, final Attributes attr, final double alpha)
{
final Point2DArray list = getPolygon();// is null for invalid arrow definition
if ((null != list) && (list.size() > 2))
{
Point2D point = list.get(0);
conte... | [
"@",
"Override",
"protected",
"boolean",
"prepare",
"(",
"final",
"Context2D",
"context",
",",
"final",
"Attributes",
"attr",
",",
"final",
"double",
"alpha",
")",
"{",
"final",
"Point2DArray",
"list",
"=",
"getPolygon",
"(",
")",
";",
"// is null for invalid ar... | Draws this arrow.
@param context the {@link Context2D} used to draw this arrow. | [
"Draws",
"this",
"arrow",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Arrow.java#L114-L140 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Movie.java | Movie.setVolume | public Movie setVolume(final double volume)
{
getAttributes().setVolume(volume);
if (null != m_video)
{
m_video.setVolume(getVolume());
}
return this;
} | java | public Movie setVolume(final double volume)
{
getAttributes().setVolume(volume);
if (null != m_video)
{
m_video.setVolume(getVolume());
}
return this;
} | [
"public",
"Movie",
"setVolume",
"(",
"final",
"double",
"volume",
")",
"{",
"getAttributes",
"(",
")",
".",
"setVolume",
"(",
"volume",
")",
";",
"if",
"(",
"null",
"!=",
"m_video",
")",
"{",
"m_video",
".",
"setVolume",
"(",
"getVolume",
"(",
")",
")"... | Sets the movie's volume
@param volume
@return this Movie | [
"Sets",
"the",
"movie",
"s",
"volume"
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Movie.java#L455-L464 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Movie.java | Movie.pause | public Movie pause()
{
if ((null != m_video) && (false == isPaused()))
{
m_pause = true;
m_video.pause();
}
return this;
} | java | public Movie pause()
{
if ((null != m_video) && (false == isPaused()))
{
m_pause = true;
m_video.pause();
}
return this;
} | [
"public",
"Movie",
"pause",
"(",
")",
"{",
"if",
"(",
"(",
"null",
"!=",
"m_video",
")",
"&&",
"(",
"false",
"==",
"isPaused",
"(",
")",
")",
")",
"{",
"m_pause",
"=",
"true",
";",
"m_video",
".",
"pause",
"(",
")",
";",
"}",
"return",
"this",
... | Pauses this movie.
@return this Movie | [
"Pauses",
"this",
"movie",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Movie.java#L491-L500 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Movie.java | Movie.setLoop | public Movie setLoop(final boolean loop)
{
getAttributes().setLoop(loop);
if (null != m_video)
{
m_video.setLoop(loop);
}
return this;
} | java | public Movie setLoop(final boolean loop)
{
getAttributes().setLoop(loop);
if (null != m_video)
{
m_video.setLoop(loop);
}
return this;
} | [
"public",
"Movie",
"setLoop",
"(",
"final",
"boolean",
"loop",
")",
"{",
"getAttributes",
"(",
")",
".",
"setLoop",
"(",
"loop",
")",
";",
"if",
"(",
"null",
"!=",
"m_video",
")",
"{",
"m_video",
".",
"setLoop",
"(",
"loop",
")",
";",
"}",
"return",
... | Sets the movie to continuously loop or not.
@param loop
@return this Movie | [
"Sets",
"the",
"movie",
"to",
"continuously",
"loop",
"or",
"not",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Movie.java#L541-L550 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Movie.java | Movie.getWidth | public int getWidth()
{
if (getAttributes().isDefined(Attribute.WIDTH))
{
final int wide = (int) (getAttributes().getWidth() + 0.5);
if (wide > 0)
{
return wide;
}
}
if (null != m_video)
{
return m_v... | java | public int getWidth()
{
if (getAttributes().isDefined(Attribute.WIDTH))
{
final int wide = (int) (getAttributes().getWidth() + 0.5);
if (wide > 0)
{
return wide;
}
}
if (null != m_video)
{
return m_v... | [
"public",
"int",
"getWidth",
"(",
")",
"{",
"if",
"(",
"getAttributes",
"(",
")",
".",
"isDefined",
"(",
"Attribute",
".",
"WIDTH",
")",
")",
"{",
"final",
"int",
"wide",
"=",
"(",
"int",
")",
"(",
"getAttributes",
"(",
")",
".",
"getWidth",
"(",
"... | Gets the width of this movie's display area
@return int | [
"Gets",
"the",
"width",
"of",
"this",
"movie",
"s",
"display",
"area"
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Movie.java#L582-L598 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Movie.java | Movie.getHeight | public int getHeight()
{
if (getAttributes().isDefined(Attribute.HEIGHT))
{
final int high = (int) (getAttributes().getHeight() + 0.5);
if (high > 0)
{
return high;
}
}
if (null != m_video)
{
return ... | java | public int getHeight()
{
if (getAttributes().isDefined(Attribute.HEIGHT))
{
final int high = (int) (getAttributes().getHeight() + 0.5);
if (high > 0)
{
return high;
}
}
if (null != m_video)
{
return ... | [
"public",
"int",
"getHeight",
"(",
")",
"{",
"if",
"(",
"getAttributes",
"(",
")",
".",
"isDefined",
"(",
"Attribute",
".",
"HEIGHT",
")",
")",
"{",
"final",
"int",
"high",
"=",
"(",
"int",
")",
"(",
"getAttributes",
"(",
")",
".",
"getHeight",
"(",
... | Gets the height of this movie's display area
@return int | [
"Gets",
"the",
"height",
"of",
"this",
"movie",
"s",
"display",
"area"
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Movie.java#L620-L636 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/wires/MagnetManager.java | MagnetManager.createMagnets | public Magnets createMagnets(final WiresShape wiresShape, final Direction[] requestedCardinals)
{
final IPrimitive<?> primTarget = wiresShape.getGroup();
final Point2DArray points = getWiresIntersectionPoints(wiresShape, requestedCardinals);
final ControlHandleList list = new ControlHandleLi... | java | public Magnets createMagnets(final WiresShape wiresShape, final Direction[] requestedCardinals)
{
final IPrimitive<?> primTarget = wiresShape.getGroup();
final Point2DArray points = getWiresIntersectionPoints(wiresShape, requestedCardinals);
final ControlHandleList list = new ControlHandleLi... | [
"public",
"Magnets",
"createMagnets",
"(",
"final",
"WiresShape",
"wiresShape",
",",
"final",
"Direction",
"[",
"]",
"requestedCardinals",
")",
"{",
"final",
"IPrimitive",
"<",
"?",
">",
"primTarget",
"=",
"wiresShape",
".",
"getGroup",
"(",
")",
";",
"final",... | Right now it only works with provided FOUR or EIGHT cardinals, anything else will break WiresConnector autoconnection
@param wiresShape
@param requestedCardinals
@return | [
"Right",
"now",
"it",
"only",
"works",
"with",
"provided",
"FOUR",
"or",
"EIGHT",
"cardinals",
"anything",
"else",
"will",
"break",
"WiresConnector",
"autoconnection"
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/wires/MagnetManager.java#L111-L138 | train |
byoutline/MockServer | src/main/java/com/byoutline/mockserver/RequestParams.java | RequestParams.matches | public boolean matches(Request req) {
if (!method.equals(req.getMethod())) return false;
if (useRegexForPath) {
if (!req.getPath().getPath().matches(basePath)) return false;
} else {
if (!basePath.equals(req.getPath().getPath())) return false;
}
if (!queri... | java | public boolean matches(Request req) {
if (!method.equals(req.getMethod())) return false;
if (useRegexForPath) {
if (!req.getPath().getPath().matches(basePath)) return false;
} else {
if (!basePath.equals(req.getPath().getPath())) return false;
}
if (!queri... | [
"public",
"boolean",
"matches",
"(",
"Request",
"req",
")",
"{",
"if",
"(",
"!",
"method",
".",
"equals",
"(",
"req",
".",
"getMethod",
"(",
")",
")",
")",
"return",
"false",
";",
"if",
"(",
"useRegexForPath",
")",
"{",
"if",
"(",
"!",
"req",
".",
... | Checks if HTTP request matches all fields specified in config.
Fails on first mismatch. Both headers and query params can be configured as regex.
@param req
@return | [
"Checks",
"if",
"HTTP",
"request",
"matches",
"all",
"fields",
"specified",
"in",
"config",
".",
"Fails",
"on",
"first",
"mismatch",
".",
"Both",
"headers",
"and",
"query",
"params",
"can",
"be",
"configured",
"as",
"regex",
"."
] | 90ab245e2eebffc88d04c2893ddbd193e67dc66e | https://github.com/byoutline/MockServer/blob/90ab245e2eebffc88d04c2893ddbd193e67dc66e/src/main/java/com/byoutline/mockserver/RequestParams.java#L39-L65 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/types/RadialGradient.java | RadialGradient.addColorStop | public final RadialGradient addColorStop(final double stop, final IColor color)
{
m_jso.addColorStop(stop, color.getColorString());
return this;
} | java | public final RadialGradient addColorStop(final double stop, final IColor color)
{
m_jso.addColorStop(stop, color.getColorString());
return this;
} | [
"public",
"final",
"RadialGradient",
"addColorStop",
"(",
"final",
"double",
"stop",
",",
"final",
"IColor",
"color",
")",
"{",
"m_jso",
".",
"addColorStop",
"(",
"stop",
",",
"color",
".",
"getColorString",
"(",
")",
")",
";",
"return",
"this",
";",
"}"
] | Add color stop
@param stop
@param color {@link ColorName} or {@link Color}
@return {@link RadialGradient} | [
"Add",
"color",
"stop"
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/types/RadialGradient.java#L69-L74 | train |
mqlight/java-mqlight | mqlight/src/main/java/com/ibm/mqlight/api/impl/logging/FFDC.java | FFDC.getThreadInfo | private static String getThreadInfo(Thread thread) {
final StringBuilder sb = new StringBuilder();
sb.append("Thread: ");
sb.append(thread.getId());
sb.append(" (");
sb.append(thread.getName());
sb.append(")");
sb.append(lineSeparator);
final StackTraceElement[] stack = thread.getSt... | java | private static String getThreadInfo(Thread thread) {
final StringBuilder sb = new StringBuilder();
sb.append("Thread: ");
sb.append(thread.getId());
sb.append(" (");
sb.append(thread.getName());
sb.append(")");
sb.append(lineSeparator);
final StackTraceElement[] stack = thread.getSt... | [
"private",
"static",
"String",
"getThreadInfo",
"(",
"Thread",
"thread",
")",
"{",
"final",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"\"Thread: \"",
")",
";",
"sb",
".",
"append",
"(",
"thread",
".",
... | Gets and formats the specified thread's information.
@param thread The thread to obtain the information from.
@return A formatted string for the thread information. | [
"Gets",
"and",
"formats",
"the",
"specified",
"thread",
"s",
"information",
"."
] | a565dfa6044050826d1221697da9e3268b557aeb | https://github.com/mqlight/java-mqlight/blob/a565dfa6044050826d1221697da9e3268b557aeb/mqlight/src/main/java/com/ibm/mqlight/api/impl/logging/FFDC.java#L157-L194 | train |
fabric8io/fabric8-forge | fabric8-forge-core/src/main/java/io/fabric8/forge/rest/git/RepositoryResource.java | RepositoryResource.getCommitTree | @GET
@Path("commitTree/{commitId}")
public List<CommitTreeInfo> getCommitTree(final @PathParam("commitId") String commitId) throws Exception {
return gitReadOperation(new GitOperation<List<CommitTreeInfo>>() {
@Override
public List<CommitTreeInfo> call(Git git, GitContext context... | java | @GET
@Path("commitTree/{commitId}")
public List<CommitTreeInfo> getCommitTree(final @PathParam("commitId") String commitId) throws Exception {
return gitReadOperation(new GitOperation<List<CommitTreeInfo>>() {
@Override
public List<CommitTreeInfo> call(Git git, GitContext context... | [
"@",
"GET",
"@",
"Path",
"(",
"\"commitTree/{commitId}\"",
")",
"public",
"List",
"<",
"CommitTreeInfo",
">",
"getCommitTree",
"(",
"final",
"@",
"PathParam",
"(",
"\"commitId\"",
")",
"String",
"commitId",
")",
"throws",
"Exception",
"{",
"return",
"gitReadOper... | Returns the file changes in a commit | [
"Returns",
"the",
"file",
"changes",
"in",
"a",
"commit"
] | a59871bae4d5c5d3ece10f1e8758e73663087f19 | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/fabric8-forge-core/src/main/java/io/fabric8/forge/rest/git/RepositoryResource.java#L433-L442 | train |
fabric8io/fabric8-forge | fabric8-forge-rest-client/src/main/java/io/fabric8/forge/rest/client/ForgeClientHelpers.java | ForgeClientHelpers.tailLog | public static TailResults tailLog(String uri, TailResults previousResults, Function<String, Void> lineProcessor) throws IOException {
URL logURL = new URL(uri);
try (InputStream inputStream = logURL.openStream()) {
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream)... | java | public static TailResults tailLog(String uri, TailResults previousResults, Function<String, Void> lineProcessor) throws IOException {
URL logURL = new URL(uri);
try (InputStream inputStream = logURL.openStream()) {
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream)... | [
"public",
"static",
"TailResults",
"tailLog",
"(",
"String",
"uri",
",",
"TailResults",
"previousResults",
",",
"Function",
"<",
"String",
",",
"Void",
">",
"lineProcessor",
")",
"throws",
"IOException",
"{",
"URL",
"logURL",
"=",
"new",
"URL",
"(",
"uri",
"... | Tails the log of the given URL such as a build log, processing all new lines since the last results | [
"Tails",
"the",
"log",
"of",
"the",
"given",
"URL",
"such",
"as",
"a",
"build",
"log",
"processing",
"all",
"new",
"lines",
"since",
"the",
"last",
"results"
] | a59871bae4d5c5d3ece10f1e8758e73663087f19 | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/fabric8-forge-rest-client/src/main/java/io/fabric8/forge/rest/client/ForgeClientHelpers.java#L139-L156 | train |
fabric8io/fabric8-forge | addons/camel-tooling-util/src/main/java/io/fabric8/camel/tooling/util/CamelModelHelper.java | CamelModelHelper.getPatternName | public static String getPatternName(OptionalIdentifiedDefinition camelNode) {
// we should grab the annotation instead
XmlRootElement root = camelNode.getClass().getAnnotation(XmlRootElement.class);
if (root != null) {
return root.name();
}
String simpleName = Strings... | java | public static String getPatternName(OptionalIdentifiedDefinition camelNode) {
// we should grab the annotation instead
XmlRootElement root = camelNode.getClass().getAnnotation(XmlRootElement.class);
if (root != null) {
return root.name();
}
String simpleName = Strings... | [
"public",
"static",
"String",
"getPatternName",
"(",
"OptionalIdentifiedDefinition",
"camelNode",
")",
"{",
"// we should grab the annotation instead",
"XmlRootElement",
"root",
"=",
"camelNode",
".",
"getClass",
"(",
")",
".",
"getAnnotation",
"(",
"XmlRootElement",
".",... | Returns the pattern name | [
"Returns",
"the",
"pattern",
"name"
] | a59871bae4d5c5d3ece10f1e8758e73663087f19 | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel-tooling-util/src/main/java/io/fabric8/camel/tooling/util/CamelModelHelper.java#L237-L245 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/mediator/EventFilter.java | EventFilter.not | public static final IEventFilter not(final IEventFilter filter)
{
return new AbstractEventFilter()
{
@Override
public final boolean test(final GwtEvent<?> event)
{
return (false == filter.test(event));
}
};
} | java | public static final IEventFilter not(final IEventFilter filter)
{
return new AbstractEventFilter()
{
@Override
public final boolean test(final GwtEvent<?> event)
{
return (false == filter.test(event));
}
};
} | [
"public",
"static",
"final",
"IEventFilter",
"not",
"(",
"final",
"IEventFilter",
"filter",
")",
"{",
"return",
"new",
"AbstractEventFilter",
"(",
")",
"{",
"@",
"Override",
"public",
"final",
"boolean",
"test",
"(",
"final",
"GwtEvent",
"<",
"?",
">",
"even... | The resulting filter will return false, if the specified filter returns true.
@param filter IEventFilter.
@return IEventFilter | [
"The",
"resulting",
"filter",
"will",
"return",
"false",
"if",
"the",
"specified",
"filter",
"returns",
"true",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/mediator/EventFilter.java#L128-L138 | train |
fabric8io/fabric8-forge | addons/utils/src/main/java/io/fabric8/forge/addon/utils/VersionHelper.java | VersionHelper.fabric8ArchetypesVersion | public static String fabric8ArchetypesVersion() {
String version = System.getenv(ENV_FABRIC8_ARCHETYPES_VERSION);
if (Strings.isNotBlank(version)) {
return version;
}
return MavenHelpers.getVersion("io.fabric8.archetypes", "archetypes-catalog");
} | java | public static String fabric8ArchetypesVersion() {
String version = System.getenv(ENV_FABRIC8_ARCHETYPES_VERSION);
if (Strings.isNotBlank(version)) {
return version;
}
return MavenHelpers.getVersion("io.fabric8.archetypes", "archetypes-catalog");
} | [
"public",
"static",
"String",
"fabric8ArchetypesVersion",
"(",
")",
"{",
"String",
"version",
"=",
"System",
".",
"getenv",
"(",
"ENV_FABRIC8_ARCHETYPES_VERSION",
")",
";",
"if",
"(",
"Strings",
".",
"isNotBlank",
"(",
"version",
")",
")",
"{",
"return",
"vers... | Returns the version to use for the fabric8 archetypes | [
"Returns",
"the",
"version",
"to",
"use",
"for",
"the",
"fabric8",
"archetypes"
] | a59871bae4d5c5d3ece10f1e8758e73663087f19 | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/utils/src/main/java/io/fabric8/forge/addon/utils/VersionHelper.java#L46-L52 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Picture.java | Picture.prepare | @Override
protected boolean prepare(final Context2D context, final Attributes attr, final double alpha)
{
context.save();
if (false == context.isSelection())
{
context.setGlobalAlpha(alpha);
if (attr.hasShadow())
{
doApplyShadow(conte... | java | @Override
protected boolean prepare(final Context2D context, final Attributes attr, final double alpha)
{
context.save();
if (false == context.isSelection())
{
context.setGlobalAlpha(alpha);
if (attr.hasShadow())
{
doApplyShadow(conte... | [
"@",
"Override",
"protected",
"boolean",
"prepare",
"(",
"final",
"Context2D",
"context",
",",
"final",
"Attributes",
"attr",
",",
"final",
"double",
"alpha",
")",
"{",
"context",
".",
"save",
"(",
")",
";",
"if",
"(",
"false",
"==",
"context",
".",
"isS... | Draws the image on the canvas.
@param context | [
"Draws",
"the",
"image",
"on",
"the",
"canvas",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Picture.java#L1485-L1504 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Layer.java | Layer.getSelectionLayer | public final SelectionLayer getSelectionLayer()
{
if (isListening())
{
if (null == m_select)
{
m_select = new SelectionLayer();
m_select.setPixelSize(getWidth(), getHeight());
}
return m_select;
}
return... | java | public final SelectionLayer getSelectionLayer()
{
if (isListening())
{
if (null == m_select)
{
m_select = new SelectionLayer();
m_select.setPixelSize(getWidth(), getHeight());
}
return m_select;
}
return... | [
"public",
"final",
"SelectionLayer",
"getSelectionLayer",
"(",
")",
"{",
"if",
"(",
"isListening",
"(",
")",
")",
"{",
"if",
"(",
"null",
"==",
"m_select",
")",
"{",
"m_select",
"=",
"new",
"SelectionLayer",
"(",
")",
";",
"m_select",
".",
"setPixelSize",
... | Returns the Selection Layer.
@return {@link SelectionLayer} | [
"Returns",
"the",
"Selection",
"Layer",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Layer.java#L164-L177 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Layer.java | Layer.attachShapeToColorMap | final void attachShapeToColorMap(final Shape<?> shape)
{
if (null != shape)
{
String color = shape.getColorKey();
if (null != color)
{
m_shape_color_map.remove(color);
shape.setColorKey(null);
}
int count =... | java | final void attachShapeToColorMap(final Shape<?> shape)
{
if (null != shape)
{
String color = shape.getColorKey();
if (null != color)
{
m_shape_color_map.remove(color);
shape.setColorKey(null);
}
int count =... | [
"final",
"void",
"attachShapeToColorMap",
"(",
"final",
"Shape",
"<",
"?",
">",
"shape",
")",
"{",
"if",
"(",
"null",
"!=",
"shape",
")",
"{",
"String",
"color",
"=",
"shape",
".",
"getColorKey",
"(",
")",
";",
"if",
"(",
"null",
"!=",
"color",
")",
... | Internal method. Attach a Shape to the Layers Color Map | [
"Internal",
"method",
".",
"Attach",
"a",
"Shape",
"to",
"the",
"Layers",
"Color",
"Map"
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Layer.java#L315-L345 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Layer.java | Layer.setPixelSize | void setPixelSize(final int wide, final int high)
{
m_wide = wide;
m_high = high;
if (LienzoCore.IS_CANVAS_SUPPORTED)
{
if (false == isSelection())
{
getElement().getStyle().setWidth(wide, Unit.PX);
getElement().getStyle().se... | java | void setPixelSize(final int wide, final int high)
{
m_wide = wide;
m_high = high;
if (LienzoCore.IS_CANVAS_SUPPORTED)
{
if (false == isSelection())
{
getElement().getStyle().setWidth(wide, Unit.PX);
getElement().getStyle().se... | [
"void",
"setPixelSize",
"(",
"final",
"int",
"wide",
",",
"final",
"int",
"high",
")",
"{",
"m_wide",
"=",
"wide",
";",
"m_high",
"=",
"high",
";",
"if",
"(",
"LienzoCore",
".",
"IS_CANVAS_SUPPORTED",
")",
"{",
"if",
"(",
"false",
"==",
"isSelection",
... | Sets this layer's pixel size.
@param wide
@param high | [
"Sets",
"this",
"layer",
"s",
"pixel",
"size",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Layer.java#L431-L462 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Layer.java | Layer.setListening | @Override
public Layer setListening(final boolean listening)
{
super.setListening(listening);
if (listening)
{
if (isShowSelectionLayer())
{
if (null != getSelectionLayer())
{
doShowSelectionLayer(true);
... | java | @Override
public Layer setListening(final boolean listening)
{
super.setListening(listening);
if (listening)
{
if (isShowSelectionLayer())
{
if (null != getSelectionLayer())
{
doShowSelectionLayer(true);
... | [
"@",
"Override",
"public",
"Layer",
"setListening",
"(",
"final",
"boolean",
"listening",
")",
"{",
"super",
".",
"setListening",
"(",
"listening",
")",
";",
"if",
"(",
"listening",
")",
"{",
"if",
"(",
"isShowSelectionLayer",
"(",
")",
")",
"{",
"if",
"... | Enables event handling on this object.
@param listening
@param Layer | [
"Enables",
"event",
"handling",
"on",
"this",
"object",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Layer.java#L470-L494 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Layer.java | Layer.setVisible | @Override
public Layer setVisible(final boolean visible)
{
super.setVisible(visible);
getElement().getStyle().setVisibility(visible ? Visibility.VISIBLE : Visibility.HIDDEN);
return this;
} | java | @Override
public Layer setVisible(final boolean visible)
{
super.setVisible(visible);
getElement().getStyle().setVisibility(visible ? Visibility.VISIBLE : Visibility.HIDDEN);
return this;
} | [
"@",
"Override",
"public",
"Layer",
"setVisible",
"(",
"final",
"boolean",
"visible",
")",
"{",
"super",
".",
"setVisible",
"(",
"visible",
")",
";",
"getElement",
"(",
")",
".",
"getStyle",
"(",
")",
".",
"setVisibility",
"(",
"visible",
"?",
"Visibility"... | Sets whether this object is visible.
@param visible
@return Layer | [
"Sets",
"whether",
"this",
"object",
"is",
"visible",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Layer.java#L802-L810 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Layer.java | Layer.clear | public void clear()
{
if (LienzoCore.get().getLayerClearMode() == LayerClearMode.CLEAR)
{
final Context2D context = getContext();
if (null != context)
{
context.clearRect(0, 0, getWidth(), getHeight());
}
}
else
... | java | public void clear()
{
if (LienzoCore.get().getLayerClearMode() == LayerClearMode.CLEAR)
{
final Context2D context = getContext();
if (null != context)
{
context.clearRect(0, 0, getWidth(), getHeight());
}
}
else
... | [
"public",
"void",
"clear",
"(",
")",
"{",
"if",
"(",
"LienzoCore",
".",
"get",
"(",
")",
".",
"getLayerClearMode",
"(",
")",
"==",
"LayerClearMode",
".",
"CLEAR",
")",
"{",
"final",
"Context2D",
"context",
"=",
"getContext",
"(",
")",
";",
"if",
"(",
... | Clears the layer. | [
"Clears",
"the",
"layer",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Layer.java#L837-L852 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Layer.java | Layer.moveUp | @SuppressWarnings("unchecked")
@Override
public Layer moveUp()
{
final Node<?> parent = getParent();
if (null != parent)
{
final IContainer<?, Layer> container = (IContainer<?, Layer>) parent.asContainer();
if (null != container)
{
... | java | @SuppressWarnings("unchecked")
@Override
public Layer moveUp()
{
final Node<?> parent = getParent();
if (null != parent)
{
final IContainer<?, Layer> container = (IContainer<?, Layer>) parent.asContainer();
if (null != container)
{
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"public",
"Layer",
"moveUp",
"(",
")",
"{",
"final",
"Node",
"<",
"?",
">",
"parent",
"=",
"getParent",
"(",
")",
";",
"if",
"(",
"null",
"!=",
"parent",
")",
"{",
"final",
"IContaine... | Moves this layer one level up.
@return Layer | [
"Moves",
"this",
"layer",
"one",
"level",
"up",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Layer.java#L869-L885 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/Context2D.java | Context2D.setFillColor | public void setFillColor(final IColor color)
{
m_jso.setFillColor((null != color) ? color.getColorString() : null);
} | java | public void setFillColor(final IColor color)
{
m_jso.setFillColor((null != color) ? color.getColorString() : null);
} | [
"public",
"void",
"setFillColor",
"(",
"final",
"IColor",
"color",
")",
"{",
"m_jso",
".",
"setFillColor",
"(",
"(",
"null",
"!=",
"color",
")",
"?",
"color",
".",
"getColorString",
"(",
")",
":",
"null",
")",
";",
"}"
] | Sets the fill color
@param color {@link ColorName} or {@link Color}
@return this Context2D | [
"Sets",
"the",
"fill",
"color"
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/Context2D.java#L136-L139 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/Context2D.java | Context2D.setStrokeColor | public void setStrokeColor(final IColor color)
{
m_jso.setStrokeColor((null != color) ? color.getColorString() : null);
} | java | public void setStrokeColor(final IColor color)
{
m_jso.setStrokeColor((null != color) ? color.getColorString() : null);
} | [
"public",
"void",
"setStrokeColor",
"(",
"final",
"IColor",
"color",
")",
"{",
"m_jso",
".",
"setStrokeColor",
"(",
"(",
"null",
"!=",
"color",
")",
"?",
"color",
".",
"getColorString",
"(",
")",
":",
"null",
")",
";",
"}"
] | Sets the stroke color
@param color {@link ColorName} or {@link Color}
@return this Context2D | [
"Sets",
"the",
"stroke",
"color"
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/Context2D.java#L178-L181 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/util/Geometry.java | Geometry.sortSpecial | public static void sortSpecial(final double[] d)
{
boolean flip;
double temp;
do
{
flip = false;
for (int i = 0; i < (d.length - 1); i++)
{
if (((d[i + 1] >= 0) && (d[i] > d[i + 1])) || ((d[i] < 0) && (d[i + 1] >= 0)))
... | java | public static void sortSpecial(final double[] d)
{
boolean flip;
double temp;
do
{
flip = false;
for (int i = 0; i < (d.length - 1); i++)
{
if (((d[i + 1] >= 0) && (d[i] > d[i + 1])) || ((d[i] < 0) && (d[i + 1] >= 0)))
... | [
"public",
"static",
"void",
"sortSpecial",
"(",
"final",
"double",
"[",
"]",
"d",
")",
"{",
"boolean",
"flip",
";",
"double",
"temp",
";",
"do",
"{",
"flip",
"=",
"false",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"(",
"d",
".",
"le... | sort, but place -1 at the end
@param d | [
"sort",
"but",
"place",
"-",
"1",
"at",
"the",
"end"
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/util/Geometry.java#L490-L510 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/util/Geometry.java | Geometry.getAngleBetweenTwoLines | public static final double getAngleBetweenTwoLines(final Point2D p0, final Point2D p1, final Point2D p2)
{
return getAngleFromSSS(p0.distance(p1), p1.distance(p2), p0.distance(p2));
} | java | public static final double getAngleBetweenTwoLines(final Point2D p0, final Point2D p1, final Point2D p2)
{
return getAngleFromSSS(p0.distance(p1), p1.distance(p2), p0.distance(p2));
} | [
"public",
"static",
"final",
"double",
"getAngleBetweenTwoLines",
"(",
"final",
"Point2D",
"p0",
",",
"final",
"Point2D",
"p1",
",",
"final",
"Point2D",
"p2",
")",
"{",
"return",
"getAngleFromSSS",
"(",
"p0",
".",
"distance",
"(",
"p1",
")",
",",
"p1",
"."... | Returns the angle between p2 -> p0 and p2 -> p2 | [
"Returns",
"the",
"angle",
"between",
"p2",
"-",
">",
"p0",
"and",
"p2",
"-",
">",
"p2"
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/util/Geometry.java#L613-L616 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/util/Geometry.java | Geometry.getClockwiseAngleBetweenThreePoints | public static double getClockwiseAngleBetweenThreePoints(final Point2D p0, final Point2D c, final Point2D p1)
{
final Point2D a = c.sub(p1);
final Point2D b = c.sub(p0);
return Math.atan2(a.getY(), a.getX()) - Math.atan2(b.getY(), b.getX());
} | java | public static double getClockwiseAngleBetweenThreePoints(final Point2D p0, final Point2D c, final Point2D p1)
{
final Point2D a = c.sub(p1);
final Point2D b = c.sub(p0);
return Math.atan2(a.getY(), a.getX()) - Math.atan2(b.getY(), b.getX());
} | [
"public",
"static",
"double",
"getClockwiseAngleBetweenThreePoints",
"(",
"final",
"Point2D",
"p0",
",",
"final",
"Point2D",
"c",
",",
"final",
"Point2D",
"p1",
")",
"{",
"final",
"Point2D",
"a",
"=",
"c",
".",
"sub",
"(",
"p1",
")",
";",
"final",
"Point2D... | Returns the clockwise angle between three points.
It starts at p0, that goes clock-wise around c until it reaches p1
@param p0
@param c
@param p1
@return | [
"Returns",
"the",
"clockwise",
"angle",
"between",
"three",
"points",
".",
"It",
"starts",
"at",
"p0",
"that",
"goes",
"clock",
"-",
"wise",
"around",
"c",
"until",
"it",
"reaches",
"p1"
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/util/Geometry.java#L627-L634 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/util/Geometry.java | Geometry.getCappedOffset | private static final double getCappedOffset(final Point2D p0, final Point2D p2, final Point2D p4, final double offset)
{
final double radius = Math.min(p2.sub(p0).getLength(), p2.sub(p4).getLength()) / 2;// it must be half, as there may be another radius on the other side, and they should not cross over.
... | java | private static final double getCappedOffset(final Point2D p0, final Point2D p2, final Point2D p4, final double offset)
{
final double radius = Math.min(p2.sub(p0).getLength(), p2.sub(p4).getLength()) / 2;// it must be half, as there may be another radius on the other side, and they should not cross over.
... | [
"private",
"static",
"final",
"double",
"getCappedOffset",
"(",
"final",
"Point2D",
"p0",
",",
"final",
"Point2D",
"p2",
",",
"final",
"Point2D",
"p4",
",",
"final",
"double",
"offset",
")",
"{",
"final",
"double",
"radius",
"=",
"Math",
".",
"min",
"(",
... | this will check if the radius needs capping, and return a smaller value if it does | [
"this",
"will",
"check",
"if",
"the",
"radius",
"needs",
"capping",
"and",
"return",
"a",
"smaller",
"value",
"if",
"it",
"does"
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/util/Geometry.java#L883-L888 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/util/Geometry.java | Geometry.intersectLineArcTo | public static final Point2DArray intersectLineArcTo(final Point2D a0, final Point2D a1, final Point2D p0, final Point2D p1, final Point2D p2, final double r)
{
final Point2DArray arcPoints = getCanvasArcToPoints(p0, p1, p2, r);
final Point2DArray circleIntersectPoints = intersectLineCircle(a0, ... | java | public static final Point2DArray intersectLineArcTo(final Point2D a0, final Point2D a1, final Point2D p0, final Point2D p1, final Point2D p2, final double r)
{
final Point2DArray arcPoints = getCanvasArcToPoints(p0, p1, p2, r);
final Point2DArray circleIntersectPoints = intersectLineCircle(a0, ... | [
"public",
"static",
"final",
"Point2DArray",
"intersectLineArcTo",
"(",
"final",
"Point2D",
"a0",
",",
"final",
"Point2D",
"a1",
",",
"final",
"Point2D",
"p0",
",",
"final",
"Point2D",
"p1",
",",
"final",
"Point2D",
"p2",
",",
"final",
"double",
"r",
")",
... | Returns the points the line intersects the arcTo path. Note that as arcTo's points are actually two
lines form p1 at a tangent to the arc's circle, it can draw a line from p0 to the start of the arc
which forms another potential intersect point.
@param a0 start of the line
@param a1 end of the line
@param p0 p0 to p1 ... | [
"Returns",
"the",
"points",
"the",
"line",
"intersects",
"the",
"arcTo",
"path",
".",
"Note",
"that",
"as",
"arcTo",
"s",
"points",
"are",
"actually",
"two",
"lines",
"form",
"p1",
"at",
"a",
"tangent",
"to",
"the",
"arc",
"s",
"circle",
"it",
"can",
"... | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/util/Geometry.java#L967-L1026 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/util/Geometry.java | Geometry.getCanvasArcToPoints | public static final Point2DArray getCanvasArcToPoints(final Point2D p0, final Point2D p1, final Point2D p2, final double r)
{
// see tangents drawn from same point to a circle
// http://www.mathcaptain.com/geometry/tangent-of-a-circle.html
final double a0 = getAngleBetweenTwoLines(p0, p1... | java | public static final Point2DArray getCanvasArcToPoints(final Point2D p0, final Point2D p1, final Point2D p2, final double r)
{
// see tangents drawn from same point to a circle
// http://www.mathcaptain.com/geometry/tangent-of-a-circle.html
final double a0 = getAngleBetweenTwoLines(p0, p1... | [
"public",
"static",
"final",
"Point2DArray",
"getCanvasArcToPoints",
"(",
"final",
"Point2D",
"p0",
",",
"final",
"Point2D",
"p1",
",",
"final",
"Point2D",
"p2",
",",
"final",
"double",
"r",
")",
"{",
"// see tangents drawn from same point to a circle\r",
"// http://w... | Canvas arcTo's have a variable center, as points a, b and c form two lines from the same point at a tangent to the arc's cirlce.
This returns the arcTo arc start, center and end points.
@param p0
@param p1
@param r
@return | [
"Canvas",
"arcTo",
"s",
"have",
"a",
"variable",
"center",
"as",
"points",
"a",
"b",
"and",
"c",
"form",
"two",
"lines",
"from",
"the",
"same",
"point",
"at",
"a",
"tangent",
"to",
"the",
"arc",
"s",
"cirlce",
".",
"This",
"returns",
"the",
"arcTo",
... | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/util/Geometry.java#L1110-L1142 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/util/Geometry.java | Geometry.getPathIntersect | public static Point2D getPathIntersect(final WiresConnection connection, final MultiPath path, final Point2D c, final int pointIndex)
{
final Point2DArray plist = connection.getConnector().getLine().getPoint2DArray();
Point2D p = plist.get(pointIndex).copy();
final Point2D offsetP = ... | java | public static Point2D getPathIntersect(final WiresConnection connection, final MultiPath path, final Point2D c, final int pointIndex)
{
final Point2DArray plist = connection.getConnector().getLine().getPoint2DArray();
Point2D p = plist.get(pointIndex).copy();
final Point2D offsetP = ... | [
"public",
"static",
"Point2D",
"getPathIntersect",
"(",
"final",
"WiresConnection",
"connection",
",",
"final",
"MultiPath",
"path",
",",
"final",
"Point2D",
"c",
",",
"final",
"int",
"pointIndex",
")",
"{",
"final",
"Point2DArray",
"plist",
"=",
"connection",
"... | Finds the intersection of the connector's end segment on a path.
@param connection
@param path
@param c
@param pointIndex
@return | [
"Finds",
"the",
"intersection",
"of",
"the",
"connector",
"s",
"end",
"segment",
"on",
"a",
"path",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/util/Geometry.java#L1179-L1214 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/util/Geometry.java | Geometry.getCardinals | public static final Point2DArray getCardinals(final BoundingBox box, final Direction[] requestedCardinals)
{
final Set<Direction> set = new HashSet<>(Arrays.asList(requestedCardinals));
final Point2DArray points = new Point2DArray();
final Point2D c = findCenter(box);
final ... | java | public static final Point2DArray getCardinals(final BoundingBox box, final Direction[] requestedCardinals)
{
final Set<Direction> set = new HashSet<>(Arrays.asList(requestedCardinals));
final Point2DArray points = new Point2DArray();
final Point2D c = findCenter(box);
final ... | [
"public",
"static",
"final",
"Point2DArray",
"getCardinals",
"(",
"final",
"BoundingBox",
"box",
",",
"final",
"Direction",
"[",
"]",
"requestedCardinals",
")",
"{",
"final",
"Set",
"<",
"Direction",
">",
"set",
"=",
"new",
"HashSet",
"<>",
"(",
"Arrays",
".... | Returns cardinal points for a given bounding box
@param box the bounding box
@return [C, N, NE, E, SE, S, SW, W, NW] | [
"Returns",
"cardinal",
"points",
"for",
"a",
"given",
"bounding",
"box"
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/util/Geometry.java#L1501-L1552 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/util/Geometry.java | Geometry.findIntersection | public static Point2D findIntersection(final int x, final int y, final MultiPath path)
{
final Point2D pointerPosition = new Point2D(x, y);
final BoundingBox box = path.getBoundingBox();
final Point2D center = findCenter(box);
// length just needs to ensure the c to xy is ... | java | public static Point2D findIntersection(final int x, final int y, final MultiPath path)
{
final Point2D pointerPosition = new Point2D(x, y);
final BoundingBox box = path.getBoundingBox();
final Point2D center = findCenter(box);
// length just needs to ensure the c to xy is ... | [
"public",
"static",
"Point2D",
"findIntersection",
"(",
"final",
"int",
"x",
",",
"final",
"int",
"y",
",",
"final",
"MultiPath",
"path",
")",
"{",
"final",
"Point2D",
"pointerPosition",
"=",
"new",
"Point2D",
"(",
"x",
",",
"y",
")",
";",
"final",
"Boun... | Finds intersecting point from the center of a path
@param x
@param y
@param path
@return the path's intersection point, or null if there's no intersection point | [
"Finds",
"intersecting",
"point",
"from",
"the",
"center",
"of",
"a",
"path"
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/util/Geometry.java#L1624-L1667 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/shared/core/types/Color.java | Color.toBrowserRGB | public static final String toBrowserRGB(final int r, final int g, final int b)
{
return "rgb(" + fixRGB(r) + "," + fixRGB(g) + "," + fixRGB(b) + ")";
} | java | public static final String toBrowserRGB(final int r, final int g, final int b)
{
return "rgb(" + fixRGB(r) + "," + fixRGB(g) + "," + fixRGB(b) + ")";
} | [
"public",
"static",
"final",
"String",
"toBrowserRGB",
"(",
"final",
"int",
"r",
",",
"final",
"int",
"g",
",",
"final",
"int",
"b",
")",
"{",
"return",
"\"rgb(\"",
"+",
"fixRGB",
"(",
"r",
")",
"+",
"\",\"",
"+",
"fixRGB",
"(",
"g",
")",
"+",
"\",... | Converts RGB integer values to a browser-compliance rgb format.
@param r int between 0 and 255
@param g int between 0 and 255
@param b int between 0 and 255
@return String e.g. "rgb(12,34,255)" | [
"Converts",
"RGB",
"integer",
"values",
"to",
"a",
"browser",
"-",
"compliance",
"rgb",
"format",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/shared/core/types/Color.java#L192-L195 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/shared/core/types/Color.java | Color.toBrowserRGBA | public static final String toBrowserRGBA(final int r, final int g, final int b, final double a)
{
return "rgba(" + fixRGB(r) + "," + fixRGB(g) + "," + fixRGB(g) + "," + fixAlpha(a) + ")";
} | java | public static final String toBrowserRGBA(final int r, final int g, final int b, final double a)
{
return "rgba(" + fixRGB(r) + "," + fixRGB(g) + "," + fixRGB(g) + "," + fixAlpha(a) + ")";
} | [
"public",
"static",
"final",
"String",
"toBrowserRGBA",
"(",
"final",
"int",
"r",
",",
"final",
"int",
"g",
",",
"final",
"int",
"b",
",",
"final",
"double",
"a",
")",
"{",
"return",
"\"rgba(\"",
"+",
"fixRGB",
"(",
"r",
")",
"+",
"\",\"",
"+",
"fixR... | Converts RGBA values to a browser-compliance rgba format.
@param r int between 0 and 255
@param g int between 0 and 255
@param b int between 0 and 255
@param b double between 0 and 1
@return String e.g. "rgba(12,34,255,0.5)" | [
"Converts",
"RGBA",
"values",
"to",
"a",
"browser",
"-",
"compliance",
"rgba",
"format",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/shared/core/types/Color.java#L206-L209 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/shared/core/types/Color.java | Color.hex2RGB | public static final Color hex2RGB(final String hex)
{
String r, g, b;
final int len = hex.length();
if (len == 7)
{
r = hex.substring(1, 3);
g = hex.substring(3, 5);
b = hex.substring(5, 7);
}
else if (len == 4)
{
... | java | public static final Color hex2RGB(final String hex)
{
String r, g, b;
final int len = hex.length();
if (len == 7)
{
r = hex.substring(1, 3);
g = hex.substring(3, 5);
b = hex.substring(5, 7);
}
else if (len == 4)
{
... | [
"public",
"static",
"final",
"Color",
"hex2RGB",
"(",
"final",
"String",
"hex",
")",
"{",
"String",
"r",
",",
"g",
",",
"b",
";",
"final",
"int",
"len",
"=",
"hex",
".",
"length",
"(",
")",
";",
"if",
"(",
"len",
"==",
"7",
")",
"{",
"r",
"=",
... | Converts Hex string to RGB. Assumes
@param hex String of length 7, e.g. "#1234EF"
@return {@link Color} | [
"Converts",
"Hex",
"string",
"to",
"RGB",
".",
"Assumes"
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/shared/core/types/Color.java#L521-L561 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/OrthogonalPolyLine.java | OrthogonalPolyLine.drawOrthogonalLineSegment | private static final Direction drawOrthogonalLineSegment(final NFastDoubleArrayJSO buffer, final Direction direction, Direction nextDirection, final double p1x, final double p1y, final double p2x, final double p2y, final double p3x, final double p3y, final boolean write)
{
if (nextDirection == null)
... | java | private static final Direction drawOrthogonalLineSegment(final NFastDoubleArrayJSO buffer, final Direction direction, Direction nextDirection, final double p1x, final double p1y, final double p2x, final double p2y, final double p3x, final double p3y, final boolean write)
{
if (nextDirection == null)
... | [
"private",
"static",
"final",
"Direction",
"drawOrthogonalLineSegment",
"(",
"final",
"NFastDoubleArrayJSO",
"buffer",
",",
"final",
"Direction",
"direction",
",",
"Direction",
"nextDirection",
",",
"final",
"double",
"p1x",
",",
"final",
"double",
"p1y",
",",
"fina... | Draws an orthogonal line between two points, it uses the previous direction to determine the new direction. It
will always attempt to continue the line in the same direction if it can do so, without requiring a corner.
If the line goes back on itself, it'll go 50% of the way and then go perpendicular, so that it no lo... | [
"Draws",
"an",
"orthogonal",
"line",
"between",
"two",
"points",
"it",
"uses",
"the",
"previous",
"direction",
"to",
"determine",
"the",
"new",
"direction",
".",
"It",
"will",
"always",
"attempt",
"to",
"continue",
"the",
"line",
"in",
"the",
"same",
"direct... | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/OrthogonalPolyLine.java#L325-L379 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/OrthogonalPolyLine.java | OrthogonalPolyLine.getNextDirection | private static Direction getNextDirection(final Direction direction, final double p1x, final double p1y, final double p2x, final double p2y)
{
Direction next_direction;
switch (direction)
{
case NORTH:
if (p2y < p1y)
{
next_dir... | java | private static Direction getNextDirection(final Direction direction, final double p1x, final double p1y, final double p2x, final double p2y)
{
Direction next_direction;
switch (direction)
{
case NORTH:
if (p2y < p1y)
{
next_dir... | [
"private",
"static",
"Direction",
"getNextDirection",
"(",
"final",
"Direction",
"direction",
",",
"final",
"double",
"p1x",
",",
"final",
"double",
"p1y",
",",
"final",
"double",
"p2x",
",",
"final",
"double",
"p2y",
")",
"{",
"Direction",
"next_direction",
"... | looks at the current and target points and based on the current direction returns the next direction. This drives the orthogonal line drawing.
@param direction
@param p1x
@param p1y
@param p2x
@param p2y
@return | [
"looks",
"at",
"the",
"current",
"and",
"target",
"points",
"and",
"based",
"on",
"the",
"current",
"direction",
"returns",
"the",
"next",
"direction",
".",
"This",
"drives",
"the",
"orthogonal",
"line",
"drawing",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/OrthogonalPolyLine.java#L391-L457 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/OrthogonalPolyLine.java | OrthogonalPolyLine.getTailDirection | private static Direction getTailDirection(final Point2DArray points, final NFastDoubleArrayJSO buffer, final Direction lastDirection, Direction tailDirection, final double correction, final OrthogonalPolyLine pline, final double p0x, final double p0y, final double p1x, final double p1y)
{
final double offse... | java | private static Direction getTailDirection(final Point2DArray points, final NFastDoubleArrayJSO buffer, final Direction lastDirection, Direction tailDirection, final double correction, final OrthogonalPolyLine pline, final double p0x, final double p0y, final double p1x, final double p1y)
{
final double offse... | [
"private",
"static",
"Direction",
"getTailDirection",
"(",
"final",
"Point2DArray",
"points",
",",
"final",
"NFastDoubleArrayJSO",
"buffer",
",",
"final",
"Direction",
"lastDirection",
",",
"Direction",
"tailDirection",
",",
"final",
"double",
"correction",
",",
"fina... | When tail is NONE it needs to try multiple directions to determine which gives the least number of corners, and then selects that as the final direction.
@param points
@param buffer
@param lastDirection
@param tailDirection
@param correction
@param pline
@param p0x
@param p0y
@param p1x
@param p1y
@return | [
"When",
"tail",
"is",
"NONE",
"it",
"needs",
"to",
"try",
"multiple",
"directions",
"to",
"determine",
"which",
"gives",
"the",
"least",
"number",
"of",
"corners",
"and",
"then",
"selects",
"that",
"as",
"the",
"final",
"direction",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/OrthogonalPolyLine.java#L474-L528 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/widget/LienzoPanel.java | LienzoPanel.setCursor | public LienzoPanel setCursor(final Cursor cursor)
{
if ((cursor != null) && (cursor != m_active_cursor))
{
m_active_cursor = cursor;
// Need to defer this, sometimes, if the browser is busy, etc, changing cursors does not take effect till events are done processing
... | java | public LienzoPanel setCursor(final Cursor cursor)
{
if ((cursor != null) && (cursor != m_active_cursor))
{
m_active_cursor = cursor;
// Need to defer this, sometimes, if the browser is busy, etc, changing cursors does not take effect till events are done processing
... | [
"public",
"LienzoPanel",
"setCursor",
"(",
"final",
"Cursor",
"cursor",
")",
"{",
"if",
"(",
"(",
"cursor",
"!=",
"null",
")",
"&&",
"(",
"cursor",
"!=",
"m_active_cursor",
")",
")",
"{",
"m_active_cursor",
"=",
"cursor",
";",
"// Need to defer this, sometimes... | Sets the type of cursor to be used when hovering above the element.
@param cursor | [
"Sets",
"the",
"type",
"of",
"cursor",
"to",
"be",
"used",
"when",
"hovering",
"above",
"the",
"element",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/widget/LienzoPanel.java#L300-L318 | train |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/widget/LienzoPanel.java | LienzoPanel.setBackgroundColor | public LienzoPanel setBackgroundColor(final String color)
{
if (null != color)
{
getElement().getStyle().setBackgroundColor(color);
}
return this;
} | java | public LienzoPanel setBackgroundColor(final String color)
{
if (null != color)
{
getElement().getStyle().setBackgroundColor(color);
}
return this;
} | [
"public",
"LienzoPanel",
"setBackgroundColor",
"(",
"final",
"String",
"color",
")",
"{",
"if",
"(",
"null",
"!=",
"color",
")",
"{",
"getElement",
"(",
")",
".",
"getStyle",
"(",
")",
".",
"setBackgroundColor",
"(",
"color",
")",
";",
"}",
"return",
"th... | Sets the background color of the LienzoPanel.
@param color String
@return this LienzoPanel | [
"Sets",
"the",
"background",
"color",
"of",
"the",
"LienzoPanel",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/widget/LienzoPanel.java#L459-L466 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/ProcessLogger.java | ProcessLogger.copyOutput | public static void copyOutput (Logger target, String name, Process process)
{
new StreamReader(target, name + " stdout", process.getInputStream()).start();
new StreamReader(target, name + " stderr", process.getErrorStream()).start();
} | java | public static void copyOutput (Logger target, String name, Process process)
{
new StreamReader(target, name + " stdout", process.getInputStream()).start();
new StreamReader(target, name + " stderr", process.getErrorStream()).start();
} | [
"public",
"static",
"void",
"copyOutput",
"(",
"Logger",
"target",
",",
"String",
"name",
",",
"Process",
"process",
")",
"{",
"new",
"StreamReader",
"(",
"target",
",",
"name",
"+",
"\" stdout\"",
",",
"process",
".",
"getInputStream",
"(",
")",
")",
".",... | Starts threads that copy the output of the supplied process's stdout and stderr streams to
the supplied target logger. When the streams reach EOF, the threads will exit. The threads
will be set to daemon so that they do not prevent the VM from exiting.
@param target the logger to which to copy the output.
@param name ... | [
"Starts",
"threads",
"that",
"copy",
"the",
"output",
"of",
"the",
"supplied",
"process",
"s",
"stdout",
"and",
"stderr",
"streams",
"to",
"the",
"supplied",
"target",
"logger",
".",
"When",
"the",
"streams",
"reach",
"EOF",
"the",
"threads",
"will",
"exit",... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/ProcessLogger.java#L29-L33 | train |
samskivert/samskivert | src/main/java/com/samskivert/jdbc/SimpleRepository.java | SimpleRepository.configureDatabaseIdent | protected void configureDatabaseIdent (String dbident)
{
_dbident = dbident;
// give the repository a chance to do any schema migration before things get further
// underway
try {
executeUpdate(new Operation<Object>() {
public Object invoke (Connection co... | java | protected void configureDatabaseIdent (String dbident)
{
_dbident = dbident;
// give the repository a chance to do any schema migration before things get further
// underway
try {
executeUpdate(new Operation<Object>() {
public Object invoke (Connection co... | [
"protected",
"void",
"configureDatabaseIdent",
"(",
"String",
"dbident",
")",
"{",
"_dbident",
"=",
"dbident",
";",
"// give the repository a chance to do any schema migration before things get further",
"// underway",
"try",
"{",
"executeUpdate",
"(",
"new",
"Operation",
"<"... | This is called automatically if a dbident is provided at construct time, but a derived class
can pass null to its constructor and then call this method itself later if it wishes to
obtain its database identifier from an overridable method which could not otherwise be
called at construct time. | [
"This",
"is",
"called",
"automatically",
"if",
"a",
"dbident",
"is",
"provided",
"at",
"construct",
"time",
"but",
"a",
"derived",
"class",
"can",
"pass",
"null",
"to",
"its",
"constructor",
"and",
"then",
"call",
"this",
"method",
"itself",
"later",
"if",
... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/SimpleRepository.java#L63-L81 | train |
samskivert/samskivert | src/main/java/com/samskivert/jdbc/SimpleRepository.java | SimpleRepository.execute | protected <V> V execute (Operation<V> op)
throws PersistenceException
{
return execute(op, true, true);
} | java | protected <V> V execute (Operation<V> op)
throws PersistenceException
{
return execute(op, true, true);
} | [
"protected",
"<",
"V",
">",
"V",
"execute",
"(",
"Operation",
"<",
"V",
">",
"op",
")",
"throws",
"PersistenceException",
"{",
"return",
"execute",
"(",
"op",
",",
"true",
",",
"true",
")",
";",
"}"
] | Executes the supplied read-only operation. In the event of a transient failure, the
repository will attempt to reestablish the database connection and try the operation again.
@return whatever value is returned by the invoked operation. | [
"Executes",
"the",
"supplied",
"read",
"-",
"only",
"operation",
".",
"In",
"the",
"event",
"of",
"a",
"transient",
"failure",
"the",
"repository",
"will",
"attempt",
"to",
"reestablish",
"the",
"database",
"connection",
"and",
"try",
"the",
"operation",
"agai... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/SimpleRepository.java#L89-L93 | train |
samskivert/samskivert | src/main/java/com/samskivert/jdbc/SimpleRepository.java | SimpleRepository.executeUpdate | protected <V> V executeUpdate (Operation<V> op)
throws PersistenceException
{
return execute(op, true, false);
} | java | protected <V> V executeUpdate (Operation<V> op)
throws PersistenceException
{
return execute(op, true, false);
} | [
"protected",
"<",
"V",
">",
"V",
"executeUpdate",
"(",
"Operation",
"<",
"V",
">",
"op",
")",
"throws",
"PersistenceException",
"{",
"return",
"execute",
"(",
"op",
",",
"true",
",",
"false",
")",
";",
"}"
] | Executes the supplied read-write operation. In the event of a transient failure, the
repository will attempt to reestablish the database connection and try the operation again.
@return whatever value is returned by the invoked operation. | [
"Executes",
"the",
"supplied",
"read",
"-",
"write",
"operation",
".",
"In",
"the",
"event",
"of",
"a",
"transient",
"failure",
"the",
"repository",
"will",
"attempt",
"to",
"reestablish",
"the",
"database",
"connection",
"and",
"try",
"the",
"operation",
"aga... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/SimpleRepository.java#L101-L105 | train |
samskivert/samskivert | src/main/java/com/samskivert/jdbc/SimpleRepository.java | SimpleRepository.update | protected int update (final String query)
throws PersistenceException
{
return executeUpdate(new Operation<Integer>() {
public Integer invoke (Connection conn, DatabaseLiaison liaison)
throws SQLException, PersistenceException
{
Statement stmt ... | java | protected int update (final String query)
throws PersistenceException
{
return executeUpdate(new Operation<Integer>() {
public Integer invoke (Connection conn, DatabaseLiaison liaison)
throws SQLException, PersistenceException
{
Statement stmt ... | [
"protected",
"int",
"update",
"(",
"final",
"String",
"query",
")",
"throws",
"PersistenceException",
"{",
"return",
"executeUpdate",
"(",
"new",
"Operation",
"<",
"Integer",
">",
"(",
")",
"{",
"public",
"Integer",
"invoke",
"(",
"Connection",
"conn",
",",
... | Executes the supplied update query in this repository, returning the number of rows
modified. | [
"Executes",
"the",
"supplied",
"update",
"query",
"in",
"this",
"repository",
"returning",
"the",
"number",
"of",
"rows",
"modified",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/SimpleRepository.java#L251-L267 | train |
samskivert/samskivert | src/main/java/com/samskivert/jdbc/SimpleRepository.java | SimpleRepository.checkedUpdate | protected void checkedUpdate (final String query, final int count)
throws PersistenceException
{
executeUpdate(new Operation<Object>() {
public Object invoke (Connection conn, DatabaseLiaison liaison)
throws SQLException, PersistenceException
{
... | java | protected void checkedUpdate (final String query, final int count)
throws PersistenceException
{
executeUpdate(new Operation<Object>() {
public Object invoke (Connection conn, DatabaseLiaison liaison)
throws SQLException, PersistenceException
{
... | [
"protected",
"void",
"checkedUpdate",
"(",
"final",
"String",
"query",
",",
"final",
"int",
"count",
")",
"throws",
"PersistenceException",
"{",
"executeUpdate",
"(",
"new",
"Operation",
"<",
"Object",
">",
"(",
")",
"{",
"public",
"Object",
"invoke",
"(",
"... | Executes the supplied update query in this repository, throwing an exception if the
modification count is not equal to the specified count. | [
"Executes",
"the",
"supplied",
"update",
"query",
"in",
"this",
"repository",
"throwing",
"an",
"exception",
"if",
"the",
"modification",
"count",
"is",
"not",
"equal",
"to",
"the",
"specified",
"count",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/SimpleRepository.java#L273-L290 | train |
samskivert/samskivert | src/main/java/com/samskivert/jdbc/SimpleRepository.java | SimpleRepository.maintenance | protected void maintenance (final String action, final String table)
throws PersistenceException
{
executeUpdate(new Operation<Object>() {
public Object invoke (Connection conn, DatabaseLiaison liaison)
throws SQLException, PersistenceException
{
... | java | protected void maintenance (final String action, final String table)
throws PersistenceException
{
executeUpdate(new Operation<Object>() {
public Object invoke (Connection conn, DatabaseLiaison liaison)
throws SQLException, PersistenceException
{
... | [
"protected",
"void",
"maintenance",
"(",
"final",
"String",
"action",
",",
"final",
"String",
"table",
")",
"throws",
"PersistenceException",
"{",
"executeUpdate",
"(",
"new",
"Operation",
"<",
"Object",
">",
"(",
")",
"{",
"public",
"Object",
"invoke",
"(",
... | Instructs MySQL to perform table maintenance on the specified table.
@param action <code>analyze</code> recomputes the distribution of the keys for the specified
table. This can help certain joins to be performed more efficiently. <code>optimize</code>
instructs MySQL to coalesce fragmented records and reclaim space l... | [
"Instructs",
"MySQL",
"to",
"perform",
"table",
"maintenance",
"on",
"the",
"specified",
"table",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/SimpleRepository.java#L323-L348 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/PropertiesUtil.java | PropertiesUtil.loadAndGet | public static String loadAndGet (File propFile, String key)
{
try {
return load(propFile).getProperty(key);
} catch (IOException ioe) {
return null;
}
} | java | public static String loadAndGet (File propFile, String key)
{
try {
return load(propFile).getProperty(key);
} catch (IOException ioe) {
return null;
}
} | [
"public",
"static",
"String",
"loadAndGet",
"(",
"File",
"propFile",
",",
"String",
"key",
")",
"{",
"try",
"{",
"return",
"load",
"(",
"propFile",
")",
".",
"getProperty",
"(",
"key",
")",
";",
"}",
"catch",
"(",
"IOException",
"ioe",
")",
"{",
"retur... | Loads up the supplied properties file and returns the specified key. Clearly this is an
expensive operation and you should load a properties file separately if you plan to retrieve
multiple keys from it. This method, however, is convenient for, say, extracting a value from
a properties file that contains only one key, ... | [
"Loads",
"up",
"the",
"supplied",
"properties",
"file",
"and",
"returns",
"the",
"specified",
"key",
".",
"Clearly",
"this",
"is",
"an",
"expensive",
"operation",
"and",
"you",
"should",
"load",
"a",
"properties",
"file",
"separately",
"if",
"you",
"plan",
"... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/PropertiesUtil.java#L182-L189 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/AbstractIntSet.java | AbstractIntSet.add | public boolean add (int[] values)
{
boolean modified = false;
int vlength = values.length;
for (int i = 0; i < vlength; i++) {
modified = (add(values[i]) || modified);
}
return modified;
} | java | public boolean add (int[] values)
{
boolean modified = false;
int vlength = values.length;
for (int i = 0; i < vlength; i++) {
modified = (add(values[i]) || modified);
}
return modified;
} | [
"public",
"boolean",
"add",
"(",
"int",
"[",
"]",
"values",
")",
"{",
"boolean",
"modified",
"=",
"false",
";",
"int",
"vlength",
"=",
"values",
".",
"length",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"vlength",
";",
"i",
"++",
")",
... | Add all of the values in the supplied array to the set.
@param values elements to be added to this set.
@return <tt>true</tt> if this set did not already contain all of the specified elements. | [
"Add",
"all",
"of",
"the",
"values",
"in",
"the",
"supplied",
"array",
"to",
"the",
"set",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/AbstractIntSet.java#L32-L40 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/AbstractIntSet.java | AbstractIntSet.remove | public boolean remove (int[] values)
{
boolean modified = false;
int vcount = values.length;
for (int i = 0; i < vcount; i++) {
modified = (remove(values[i]) || modified);
}
return modified;
} | java | public boolean remove (int[] values)
{
boolean modified = false;
int vcount = values.length;
for (int i = 0; i < vcount; i++) {
modified = (remove(values[i]) || modified);
}
return modified;
} | [
"public",
"boolean",
"remove",
"(",
"int",
"[",
"]",
"values",
")",
"{",
"boolean",
"modified",
"=",
"false",
";",
"int",
"vcount",
"=",
"values",
".",
"length",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"vcount",
";",
"i",
"++",
")",... | Removes all values in the supplied array from the set. Any values that are in the array but
not in the set are simply ignored.
@param values elements to be removed from the set.
@return <tt>true</tt> if this set contained any of the specified elements (which will have
been removed). | [
"Removes",
"all",
"values",
"in",
"the",
"supplied",
"array",
"from",
"the",
"set",
".",
"Any",
"values",
"that",
"are",
"in",
"the",
"array",
"but",
"not",
"in",
"the",
"set",
"are",
"simply",
"ignored",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/AbstractIntSet.java#L51-L59 | train |
samskivert/samskivert | src/main/java/com/samskivert/swing/ComboButtonBox.java | ComboButtonBox.setSelectedIndex | public void setSelectedIndex (int selidx)
{
// update the display
updateSelection(selidx);
// let the model know what's up
Object item = (selidx == -1) ? null : _model.getElementAt(selidx);
_model.setSelectedItem(item);
} | java | public void setSelectedIndex (int selidx)
{
// update the display
updateSelection(selidx);
// let the model know what's up
Object item = (selidx == -1) ? null : _model.getElementAt(selidx);
_model.setSelectedItem(item);
} | [
"public",
"void",
"setSelectedIndex",
"(",
"int",
"selidx",
")",
"{",
"// update the display",
"updateSelection",
"(",
"selidx",
")",
";",
"// let the model know what's up",
"Object",
"item",
"=",
"(",
"selidx",
"==",
"-",
"1",
")",
"?",
"null",
":",
"_model",
... | Sets the index of the selected component. A value of -1 will clear
the selection. | [
"Sets",
"the",
"index",
"of",
"the",
"selected",
"component",
".",
"A",
"value",
"of",
"-",
"1",
"will",
"clear",
"the",
"selection",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/ComboButtonBox.java#L118-L126 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.