id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
147,200 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/spatial/LineSegment.java | LineSegment.intersects | public boolean intersects(LineSegment lineSegment) {
double x1 = this.x1();
double y1 = this.y1();
double x2 = this.x2();
double y2 = this.y2();
double x3 = lineSegment.x1();
double y3 = lineSegment.y1();
double x4 = lineSegment.x2();
double y4 = lineSegment.y2();
double denom = (y4 - y3) * (x2 - x1)... | java | public boolean intersects(LineSegment lineSegment) {
double x1 = this.x1();
double y1 = this.y1();
double x2 = this.x2();
double y2 = this.y2();
double x3 = lineSegment.x1();
double y3 = lineSegment.y1();
double x4 = lineSegment.x2();
double y4 = lineSegment.y2();
double denom = (y4 - y3) * (x2 - x1)... | [
"public",
"boolean",
"intersects",
"(",
"LineSegment",
"lineSegment",
")",
"{",
"double",
"x1",
"=",
"this",
".",
"x1",
"(",
")",
";",
"double",
"y1",
"=",
"this",
".",
"y1",
"(",
")",
";",
"double",
"x2",
"=",
"this",
".",
"x2",
"(",
")",
";",
"... | Does this linesegment intersect with another or not?
@param lineSegment
The other linesegment.
@return Returns true if they intersect in 1 point, false otherwise. | [
"Does",
"this",
"linesegment",
"intersect",
"with",
"another",
"or",
"not?"
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/spatial/LineSegment.java#L90-L107 |
147,201 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/spatial/LineSegment.java | LineSegment.getIntersectionSegments | public Coordinate getIntersectionSegments(LineSegment lineSegment) {
// http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/
double x1 = this.x1();
double y1 = this.y1();
double x2 = this.x2();
double y2 = this.y2();
double x3 = lineSegment.x1();
double y3 = lineSegment.y1();
double x4 = lineSegme... | java | public Coordinate getIntersectionSegments(LineSegment lineSegment) {
// http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/
double x1 = this.x1();
double y1 = this.y1();
double x2 = this.x2();
double y2 = this.y2();
double x3 = lineSegment.x1();
double y3 = lineSegment.y1();
double x4 = lineSegme... | [
"public",
"Coordinate",
"getIntersectionSegments",
"(",
"LineSegment",
"lineSegment",
")",
"{",
"// http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/",
"double",
"x1",
"=",
"this",
".",
"x1",
"(",
")",
";",
"double",
"y1",
"=",
"this",
".",
"y1",
"(",
")",
... | Return the intersection point of 2 line segments if they intersect in 1 point.
@param lineSegment
The other LineSegment.
@return A {@link Coordinate} representing the intersection point (so on both line segments), null if segments are
not intersecting or corresponding lines are coinciding. | [
"Return",
"the",
"intersection",
"point",
"of",
"2",
"line",
"segments",
"if",
"they",
"intersect",
"in",
"1",
"point",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/spatial/LineSegment.java#L145-L172 |
147,202 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/spatial/LineSegment.java | LineSegment.nearest | public Coordinate nearest(Coordinate c) {
double len = this.getLength();
double u = (c.getX() - this.c1.getX()) * (this.c2.getX() - this.c1.getX()) + (c.getY() - this.c1.getY())
* (this.c2.getY() - this.c1.getY());
u = u / (len * len);
if (u < 0.00001 || u > 1) {
// Shortest point not within LineSegmen... | java | public Coordinate nearest(Coordinate c) {
double len = this.getLength();
double u = (c.getX() - this.c1.getX()) * (this.c2.getX() - this.c1.getX()) + (c.getY() - this.c1.getY())
* (this.c2.getY() - this.c1.getY());
u = u / (len * len);
if (u < 0.00001 || u > 1) {
// Shortest point not within LineSegmen... | [
"public",
"Coordinate",
"nearest",
"(",
"Coordinate",
"c",
")",
"{",
"double",
"len",
"=",
"this",
".",
"getLength",
"(",
")",
";",
"double",
"u",
"=",
"(",
"c",
".",
"getX",
"(",
")",
"-",
"this",
".",
"c1",
".",
"getX",
"(",
")",
")",
"*",
"(... | Calculate which point on the LineSegment is nearest to the given coordinate. Will be perpendicular or one of the
end-points.
@param c
The coordinate to check.
@return The point on the LineSegment nearest to the given coordinate. | [
"Calculate",
"which",
"point",
"on",
"the",
"LineSegment",
"is",
"nearest",
"to",
"the",
"given",
"coordinate",
".",
"Will",
"be",
"perpendicular",
"or",
"one",
"of",
"the",
"end",
"-",
"points",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/spatial/LineSegment.java#L182-L205 |
147,203 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/context/SvgGraphicsContext.java | SvgGraphicsContext.unhide | public void unhide(Object group) {
if (isAttached()) {
Element element = helper.getGroup(group);
if (element != null) {
Dom.setElementAttribute(element, "display", "inline");
}
}
} | java | public void unhide(Object group) {
if (isAttached()) {
Element element = helper.getGroup(group);
if (element != null) {
Dom.setElementAttribute(element, "display", "inline");
}
}
} | [
"public",
"void",
"unhide",
"(",
"Object",
"group",
")",
"{",
"if",
"(",
"isAttached",
"(",
")",
")",
"{",
"Element",
"element",
"=",
"helper",
".",
"getGroup",
"(",
"group",
")",
";",
"if",
"(",
"element",
"!=",
"null",
")",
"{",
"Dom",
".",
"setE... | Show the specified group. If the group does not exist, nothing will happen.
@param group
The group object. | [
"Show",
"the",
"specified",
"group",
".",
"If",
"the",
"group",
"does",
"not",
"exist",
"nothing",
"will",
"happen",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/SvgGraphicsContext.java#L745-L752 |
147,204 | geomajas/geomajas-project-client-gwt | plugin/widget-searchandfilter/searchandfilter-gwt/src/main/java/org/geomajas/widget/searchandfilter/client/widget/search/SearchEvent.java | SearchEvent.isSingleResult | public boolean isSingleResult() {
if (result == null) {
return false;
} else {
if (singleResult == null) {
if (result.size() == 1 && result.values().iterator().next().size() == 1) {
singleResult = true;
} else {
singleResult = false;
}
}
return singleResult;
}
} | java | public boolean isSingleResult() {
if (result == null) {
return false;
} else {
if (singleResult == null) {
if (result.size() == 1 && result.values().iterator().next().size() == 1) {
singleResult = true;
} else {
singleResult = false;
}
}
return singleResult;
}
} | [
"public",
"boolean",
"isSingleResult",
"(",
")",
"{",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"else",
"{",
"if",
"(",
"singleResult",
"==",
"null",
")",
"{",
"if",
"(",
"result",
".",
"size",
"(",
")",
"==",
"1",
... | Returns true if the search resulted in a single result in a single layer.
false in all other cases. Also returns false when search has not yet been
run.
@return | [
"Returns",
"true",
"if",
"the",
"search",
"resulted",
"in",
"a",
"single",
"result",
"in",
"a",
"single",
"layer",
".",
"false",
"in",
"all",
"other",
"cases",
".",
"Also",
"returns",
"false",
"when",
"search",
"has",
"not",
"yet",
"been",
"run",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/plugin/widget-searchandfilter/searchandfilter-gwt/src/main/java/org/geomajas/widget/searchandfilter/client/widget/search/SearchEvent.java#L54-L67 |
147,205 | seedstack/i18n-addon | rest/src/main/java/org/seedstack/i18n/rest/internal/locale/DefaultLanguageResource.java | DefaultLanguageResource.changeDefaultLocale | @PUT
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@RequiresPermissions(I18nPermissions.LOCALE_WRITE)
public Response changeDefaultLocale(LocaleRepresentation representation) throws URISyntaxException {
WebAssertions.assertNotNull(representation, "The locale should ... | java | @PUT
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@RequiresPermissions(I18nPermissions.LOCALE_WRITE)
public Response changeDefaultLocale(LocaleRepresentation representation) throws URISyntaxException {
WebAssertions.assertNotNull(representation, "The locale should ... | [
"@",
"PUT",
"@",
"Consumes",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"RequiresPermissions",
"(",
"I18nPermissions",
".",
"LOCALE_WRITE",
")",
"public",
"Response",
"changeDefaultLocale",
... | Changes the default locale
@param representation locale representation
@return result
@throws java.net.URISyntaxException if URI is not valid | [
"Changes",
"the",
"default",
"locale"
] | 1e65101d8554623f09bda2497b0151fd10a16615 | https://github.com/seedstack/i18n-addon/blob/1e65101d8554623f09bda2497b0151fd10a16615/rest/src/main/java/org/seedstack/i18n/rest/internal/locale/DefaultLanguageResource.java#L74-L90 |
147,206 | geomajas/geomajas-project-client-gwt | plugin/editing/editing-gwt/src/main/java/org/geomajas/plugin/editing/gwt/client/handler/BaseDragLineHandler.java | BaseDragLineHandler.register | public void register() {
registrations.add(editService.addGeometryEditMoveHandler(this));
registrations.add(editService.addGeometryEditShapeChangedHandler(this));
registrations.add(editService.addGeometryEditTentativeMoveHandler(this));
registrations.add(editService.addGeometryEditChangeStateHandler(this));
} | java | public void register() {
registrations.add(editService.addGeometryEditMoveHandler(this));
registrations.add(editService.addGeometryEditShapeChangedHandler(this));
registrations.add(editService.addGeometryEditTentativeMoveHandler(this));
registrations.add(editService.addGeometryEditChangeStateHandler(this));
} | [
"public",
"void",
"register",
"(",
")",
"{",
"registrations",
".",
"add",
"(",
"editService",
".",
"addGeometryEditMoveHandler",
"(",
"this",
")",
")",
";",
"registrations",
".",
"add",
"(",
"editService",
".",
"addGeometryEditShapeChangedHandler",
"(",
"this",
... | Register handlers. Activates this handler. | [
"Register",
"handlers",
".",
"Activates",
"this",
"handler",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/plugin/editing/editing-gwt/src/main/java/org/geomajas/plugin/editing/gwt/client/handler/BaseDragLineHandler.java#L54-L59 |
147,207 | geomajas/geomajas-project-client-gwt | plugin/widget-featureinfo/featureinfo-gwt/src/main/java/org/geomajas/widget/featureinfo/client/action/toolbar/MultiLayerFeatureInfoListener.java | MultiLayerFeatureInfoListener.toBbox | private org.geomajas.geometry.Bbox toBbox(Bbox bounds) {
return new org.geomajas.geometry.Bbox(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight());
} | java | private org.geomajas.geometry.Bbox toBbox(Bbox bounds) {
return new org.geomajas.geometry.Bbox(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight());
} | [
"private",
"org",
".",
"geomajas",
".",
"geometry",
".",
"Bbox",
"toBbox",
"(",
"Bbox",
"bounds",
")",
"{",
"return",
"new",
"org",
".",
"geomajas",
".",
"geometry",
".",
"Bbox",
"(",
"bounds",
".",
"getX",
"(",
")",
",",
"bounds",
".",
"getY",
"(",
... | Convert to Bbox DTO.
@param bounds bounds
@return DTO | [
"Convert",
"to",
"Bbox",
"DTO",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/plugin/widget-featureinfo/featureinfo-gwt/src/main/java/org/geomajas/widget/featureinfo/client/action/toolbar/MultiLayerFeatureInfoListener.java#L240-L242 |
147,208 | geomajas/geomajas-project-client-gwt | common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/service/ClientConfigurationService.java | ClientConfigurationService.addCallback | private static boolean addCallback(String applicationId, DelayedCallback callback) {
boolean isFirst = false;
List<DelayedCallback> list = BACKLOG.get(applicationId);
if (null == list) {
list = new ArrayList<DelayedCallback>();
BACKLOG.put(applicationId, list);
isFirst = true;
}
list.add(callback);
... | java | private static boolean addCallback(String applicationId, DelayedCallback callback) {
boolean isFirst = false;
List<DelayedCallback> list = BACKLOG.get(applicationId);
if (null == list) {
list = new ArrayList<DelayedCallback>();
BACKLOG.put(applicationId, list);
isFirst = true;
}
list.add(callback);
... | [
"private",
"static",
"boolean",
"addCallback",
"(",
"String",
"applicationId",
",",
"DelayedCallback",
"callback",
")",
"{",
"boolean",
"isFirst",
"=",
"false",
";",
"List",
"<",
"DelayedCallback",
">",
"list",
"=",
"BACKLOG",
".",
"get",
"(",
"applicationId",
... | Add a delayed callback for the given application id. Returns whether this is the first request for the
application id.
@param applicationId application id
@param callback callback
@return true when first request for that application id | [
"Add",
"a",
"delayed",
"callback",
"for",
"the",
"given",
"application",
"id",
".",
"Returns",
"whether",
"this",
"is",
"the",
"first",
"request",
"for",
"the",
"application",
"id",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/service/ClientConfigurationService.java#L107-L117 |
147,209 | geomajas/geomajas-project-client-gwt | common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/service/ClientConfigurationService.java | ClientConfigurationService.getMapWidgetInfo | public static void getMapWidgetInfo(final String applicationId, final String mapId, final String name,
final WidgetConfigurationCallback callback) {
if (!CONFIG.containsKey(applicationId)) {
if (addCallback(applicationId, new DelayedCallback(mapId, name, callback))) {
configurationLoader.loadClientApplicati... | java | public static void getMapWidgetInfo(final String applicationId, final String mapId, final String name,
final WidgetConfigurationCallback callback) {
if (!CONFIG.containsKey(applicationId)) {
if (addCallback(applicationId, new DelayedCallback(mapId, name, callback))) {
configurationLoader.loadClientApplicati... | [
"public",
"static",
"void",
"getMapWidgetInfo",
"(",
"final",
"String",
"applicationId",
",",
"final",
"String",
"mapId",
",",
"final",
"String",
"name",
",",
"final",
"WidgetConfigurationCallback",
"callback",
")",
"{",
"if",
"(",
"!",
"CONFIG",
".",
"containsK... | Get the configuration for a specific widget. This method will search within the context of a specific map. This
means that it will find maps, tool-bars and layer trees as well as the widget configurations within a map.
@param applicationId
The application name wherein to search for the widget configuration.
@param map... | [
"Get",
"the",
"configuration",
"for",
"a",
"specific",
"widget",
".",
"This",
"method",
"will",
"search",
"within",
"the",
"context",
"of",
"a",
"specific",
"map",
".",
"This",
"means",
"that",
"it",
"will",
"find",
"maps",
"tool",
"-",
"bars",
"and",
"l... | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/service/ClientConfigurationService.java#L134-L143 |
147,210 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/feature/FeatureTransaction.java | FeatureTransaction.execute | public void execute(FeatureOperation op) {
if (newFeatures != null && newFeatures.length > 0) {
operationQueue.add(op);
for (Feature newFeature : newFeatures) {
op.execute(newFeature);
}
}
} | java | public void execute(FeatureOperation op) {
if (newFeatures != null && newFeatures.length > 0) {
operationQueue.add(op);
for (Feature newFeature : newFeatures) {
op.execute(newFeature);
}
}
} | [
"public",
"void",
"execute",
"(",
"FeatureOperation",
"op",
")",
"{",
"if",
"(",
"newFeatures",
"!=",
"null",
"&&",
"newFeatures",
".",
"length",
">",
"0",
")",
"{",
"operationQueue",
".",
"add",
"(",
"op",
")",
";",
"for",
"(",
"Feature",
"newFeature",
... | Execute an operation on each of the features from the "newFeature" array. Also store the operation on a queue, so
it is possible to undo all the changes afterwards.
@param op
The operation to apply on each feature. | [
"Execute",
"an",
"operation",
"on",
"each",
"of",
"the",
"features",
"from",
"the",
"newFeature",
"array",
".",
"Also",
"store",
"the",
"operation",
"on",
"a",
"queue",
"so",
"it",
"is",
"possible",
"to",
"undo",
"all",
"the",
"changes",
"afterwards",
"."
... | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/feature/FeatureTransaction.java#L88-L95 |
147,211 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/feature/FeatureTransaction.java | FeatureTransaction.toDto | public org.geomajas.layer.feature.FeatureTransaction toDto() {
org.geomajas.layer.feature.FeatureTransaction dto = new org.geomajas.layer.feature.FeatureTransaction();
dto.setLayerId(layer.getServerLayerId());
if (oldFeatures != null) {
org.geomajas.layer.feature.Feature[] oldDto = new org.geomajas.layer.featu... | java | public org.geomajas.layer.feature.FeatureTransaction toDto() {
org.geomajas.layer.feature.FeatureTransaction dto = new org.geomajas.layer.feature.FeatureTransaction();
dto.setLayerId(layer.getServerLayerId());
if (oldFeatures != null) {
org.geomajas.layer.feature.Feature[] oldDto = new org.geomajas.layer.featu... | [
"public",
"org",
".",
"geomajas",
".",
"layer",
".",
"feature",
".",
"FeatureTransaction",
"toDto",
"(",
")",
"{",
"org",
".",
"geomajas",
".",
"layer",
".",
"feature",
".",
"FeatureTransaction",
"dto",
"=",
"new",
"org",
".",
"geomajas",
".",
"layer",
"... | Transform this object into a DTO feature transaction.
@return feature transaction DTO | [
"Transform",
"this",
"object",
"into",
"a",
"DTO",
"feature",
"transaction",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/feature/FeatureTransaction.java#L135-L153 |
147,212 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/paintable/Circle.java | Circle.setPosition | public void setPosition(Coordinate position) {
if (getOriginalLocation() != null) {
Bbox oldBounds = (Bbox) getOriginalLocation();
Bbox newBounds = (Bbox) oldBounds.clone();
newBounds.setCenterPoint(position);
setOriginalLocation(newBounds);
} else {
setOriginalLocation(new Bbox(position.getX(), posi... | java | public void setPosition(Coordinate position) {
if (getOriginalLocation() != null) {
Bbox oldBounds = (Bbox) getOriginalLocation();
Bbox newBounds = (Bbox) oldBounds.clone();
newBounds.setCenterPoint(position);
setOriginalLocation(newBounds);
} else {
setOriginalLocation(new Bbox(position.getX(), posi... | [
"public",
"void",
"setPosition",
"(",
"Coordinate",
"position",
")",
"{",
"if",
"(",
"getOriginalLocation",
"(",
")",
"!=",
"null",
")",
"{",
"Bbox",
"oldBounds",
"=",
"(",
"Bbox",
")",
"getOriginalLocation",
"(",
")",
";",
"Bbox",
"newBounds",
"=",
"(",
... | Set circle position in world space.
@param position circle center | [
"Set",
"circle",
"position",
"in",
"world",
"space",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/paintable/Circle.java#L77-L86 |
147,213 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/paintable/Circle.java | Circle.setRadius | public void setRadius(float radius) {
if (getOriginalLocation() != null) {
Bbox oldBounds = (Bbox) getOriginalLocation();
Bbox newBounds = (Bbox) oldBounds.clone();
newBounds.setWidth(2 * radius);
newBounds.setHeight(2 * radius);
newBounds.setCenterPoint(oldBounds.getCenterPoint());
setOriginalLocat... | java | public void setRadius(float radius) {
if (getOriginalLocation() != null) {
Bbox oldBounds = (Bbox) getOriginalLocation();
Bbox newBounds = (Bbox) oldBounds.clone();
newBounds.setWidth(2 * radius);
newBounds.setHeight(2 * radius);
newBounds.setCenterPoint(oldBounds.getCenterPoint());
setOriginalLocat... | [
"public",
"void",
"setRadius",
"(",
"float",
"radius",
")",
"{",
"if",
"(",
"getOriginalLocation",
"(",
")",
"!=",
"null",
")",
"{",
"Bbox",
"oldBounds",
"=",
"(",
"Bbox",
")",
"getOriginalLocation",
"(",
")",
";",
"Bbox",
"newBounds",
"=",
"(",
"Bbox",
... | Set circle radius in world coordinates.
@param radius circle radius in world units | [
"Set",
"circle",
"radius",
"in",
"world",
"coordinates",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/paintable/Circle.java#L107-L118 |
147,214 | geomajas/geomajas-project-client-gwt | plugin/editing/editing-javascript-api-gwt/src/main/java/org/geomajas/plugin/editing/jsapi/gwt/client/contextmenu/JsGeometryContextMenuRegistry.java | JsGeometryContextMenuRegistry.addVertexAction | public void addVertexAction(final JsGeometryContextMenuAction action, String title) {
delegate.addVertexAction(new GeometryContextMenuAction(title, null) {
@Override
public void onClick(MenuItemClickEvent event) {
action.execute(JsGeometryContextMenuRegistry.this);
}
});
} | java | public void addVertexAction(final JsGeometryContextMenuAction action, String title) {
delegate.addVertexAction(new GeometryContextMenuAction(title, null) {
@Override
public void onClick(MenuItemClickEvent event) {
action.execute(JsGeometryContextMenuRegistry.this);
}
});
} | [
"public",
"void",
"addVertexAction",
"(",
"final",
"JsGeometryContextMenuAction",
"action",
",",
"String",
"title",
")",
"{",
"delegate",
".",
"addVertexAction",
"(",
"new",
"GeometryContextMenuAction",
"(",
"title",
",",
"null",
")",
"{",
"@",
"Override",
"public... | Adds a vertex context menu action.
@param action
@param title | [
"Adds",
"a",
"vertex",
"context",
"menu",
"action",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/plugin/editing/editing-javascript-api-gwt/src/main/java/org/geomajas/plugin/editing/jsapi/gwt/client/contextmenu/JsGeometryContextMenuRegistry.java#L60-L69 |
147,215 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/action/menu/InsertRingAction.java | InsertRingAction.onClick | public void onClick(MenuItemClickEvent event) {
final FeatureTransaction ft = mapWidget.getMapModel().getFeatureEditor().getFeatureTransaction();
if (ft != null && index != null) {
List<Feature> features = new ArrayList<Feature>();
features.add(ft.getNewFeatures()[index.getFeatureIndex()]);
LazyLoader.lazy... | java | public void onClick(MenuItemClickEvent event) {
final FeatureTransaction ft = mapWidget.getMapModel().getFeatureEditor().getFeatureTransaction();
if (ft != null && index != null) {
List<Feature> features = new ArrayList<Feature>();
features.add(ft.getNewFeatures()[index.getFeatureIndex()]);
LazyLoader.lazy... | [
"public",
"void",
"onClick",
"(",
"MenuItemClickEvent",
"event",
")",
"{",
"final",
"FeatureTransaction",
"ft",
"=",
"mapWidget",
".",
"getMapModel",
"(",
")",
".",
"getFeatureEditor",
"(",
")",
".",
"getFeatureTransaction",
"(",
")",
";",
"if",
"(",
"ft",
"... | Insert a new point in the geometry at a given index. The index is taken from the context menu event. This
function will add a new empty interior ring in the polygon in question.
@param event
The {@link MenuItemClickEvent} from clicking the action. | [
"Insert",
"a",
"new",
"point",
"in",
"the",
"geometry",
"at",
"a",
"given",
"index",
".",
"The",
"index",
"is",
"taken",
"from",
"the",
"context",
"menu",
"event",
".",
"This",
"function",
"will",
"add",
"a",
"new",
"empty",
"interior",
"ring",
"in",
"... | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/action/menu/InsertRingAction.java#L77-L98 |
147,216 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/widget/FeatureListGrid.java | FeatureListGrid.setLayer | public void setLayer(VectorLayer layer) {
this.layer = layer;
if (layer == null) {
clear();
} else {
empty();
updateFields();
}
} | java | public void setLayer(VectorLayer layer) {
this.layer = layer;
if (layer == null) {
clear();
} else {
empty();
updateFields();
}
} | [
"public",
"void",
"setLayer",
"(",
"VectorLayer",
"layer",
")",
"{",
"this",
".",
"layer",
"=",
"layer",
";",
"if",
"(",
"layer",
"==",
"null",
")",
"{",
"clear",
"(",
")",
";",
"}",
"else",
"{",
"empty",
"(",
")",
";",
"updateFields",
"(",
")",
... | Apply a new layer onto the grid. This means that the table header will immediately take on the attributes of this
new layer.
@param layer
The layer from whom to display the features. If this is null, the table will be cleared. | [
"Apply",
"a",
"new",
"layer",
"onto",
"the",
"grid",
".",
"This",
"means",
"that",
"the",
"table",
"header",
"will",
"immediately",
"take",
"on",
"the",
"attributes",
"of",
"this",
"new",
"layer",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/widget/FeatureListGrid.java#L288-L296 |
147,217 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/widget/FeatureListGrid.java | FeatureListGrid.setSelectionEnabled | public void setSelectionEnabled(boolean selectionEnabled) {
// Clean up first! Otherwise the handler list would just keep on growing.
if (selectionRegistration != null) {
selectionRegistration.removeHandler();
selectionRegistration = null;
}
if (gridSelectionRegistration != null) {
gridSelectionRegistr... | java | public void setSelectionEnabled(boolean selectionEnabled) {
// Clean up first! Otherwise the handler list would just keep on growing.
if (selectionRegistration != null) {
selectionRegistration.removeHandler();
selectionRegistration = null;
}
if (gridSelectionRegistration != null) {
gridSelectionRegistr... | [
"public",
"void",
"setSelectionEnabled",
"(",
"boolean",
"selectionEnabled",
")",
"{",
"// Clean up first! Otherwise the handler list would just keep on growing.",
"if",
"(",
"selectionRegistration",
"!=",
"null",
")",
"{",
"selectionRegistration",
".",
"removeHandler",
"(",
... | Adds or removes this widget as a handler for selection onto the MapModel. What this means is that when selection
is enabled, selected rows in the grid will result in selected features in the MapModel and vice versa.
@param selectionEnabled
is selection enabled? | [
"Adds",
"or",
"removes",
"this",
"widget",
"as",
"a",
"handler",
"for",
"selection",
"onto",
"the",
"MapModel",
".",
"What",
"this",
"means",
"is",
"that",
"when",
"selection",
"is",
"enabled",
"selected",
"rows",
"in",
"the",
"grid",
"will",
"result",
"in... | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/widget/FeatureListGrid.java#L315-L335 |
147,218 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/widget/FeatureListGrid.java | FeatureListGrid.createAttributeGridField | private ListGridField createAttributeGridField(final AttributeInfo attributeInfo) {
ListGridField gridField = new ListGridField(attributeInfo.getName(), attributeInfo.getLabel());
gridField.setAlign(Alignment.LEFT);
gridField.setCanEdit(false);
gridField.setShowIfCondition(new IdentifyingListGridFieldIfFunction... | java | private ListGridField createAttributeGridField(final AttributeInfo attributeInfo) {
ListGridField gridField = new ListGridField(attributeInfo.getName(), attributeInfo.getLabel());
gridField.setAlign(Alignment.LEFT);
gridField.setCanEdit(false);
gridField.setShowIfCondition(new IdentifyingListGridFieldIfFunction... | [
"private",
"ListGridField",
"createAttributeGridField",
"(",
"final",
"AttributeInfo",
"attributeInfo",
")",
"{",
"ListGridField",
"gridField",
"=",
"new",
"ListGridField",
"(",
"attributeInfo",
".",
"getName",
"(",
")",
",",
"attributeInfo",
".",
"getLabel",
"(",
"... | Create a single field definition from a attribute definition.
@param attributeInfo
attribute info
@return field for grid | [
"Create",
"a",
"single",
"field",
"definition",
"from",
"a",
"attribute",
"definition",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/widget/FeatureListGrid.java#L552-L591 |
147,219 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/spatial/geometry/Polygon.java | Polygon.getInteriorRingN | public LinearRing getInteriorRingN(int n) {
if (!isEmpty()) {
if (interiorRings != null && interiorRings.length > n) {
return interiorRings[n];
}
}
return null;
} | java | public LinearRing getInteriorRingN(int n) {
if (!isEmpty()) {
if (interiorRings != null && interiorRings.length > n) {
return interiorRings[n];
}
}
return null;
} | [
"public",
"LinearRing",
"getInteriorRingN",
"(",
"int",
"n",
")",
"{",
"if",
"(",
"!",
"isEmpty",
"(",
")",
")",
"{",
"if",
"(",
"interiorRings",
"!=",
"null",
"&&",
"interiorRings",
".",
"length",
">",
"n",
")",
"{",
"return",
"interiorRings",
"[",
"n... | Get one of the interior LinearRing geometries. i.e. one of the holes.
@param n
Index in the geometry's interior rings.
@return Returns the hole if it exists, null otherwise. | [
"Get",
"one",
"of",
"the",
"interior",
"LinearRing",
"geometries",
".",
"i",
".",
"e",
".",
"one",
"of",
"the",
"holes",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/spatial/geometry/Polygon.java#L75-L82 |
147,220 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/spatial/geometry/Polygon.java | Polygon.getNumPoints | public int getNumPoints() {
if (isEmpty()) {
return 0;
}
int total = exteriorRing.getNumPoints();
if (interiorRings != null) {
for (LinearRing interiorRing : interiorRings) {
total += interiorRing.getNumPoints();
}
}
return total;
} | java | public int getNumPoints() {
if (isEmpty()) {
return 0;
}
int total = exteriorRing.getNumPoints();
if (interiorRings != null) {
for (LinearRing interiorRing : interiorRings) {
total += interiorRing.getNumPoints();
}
}
return total;
} | [
"public",
"int",
"getNumPoints",
"(",
")",
"{",
"if",
"(",
"isEmpty",
"(",
")",
")",
"{",
"return",
"0",
";",
"}",
"int",
"total",
"=",
"exteriorRing",
".",
"getNumPoints",
"(",
")",
";",
"if",
"(",
"interiorRings",
"!=",
"null",
")",
"{",
"for",
"... | Return the sum of all points in the exterior ring + the total number of points in all the interior rings. | [
"Return",
"the",
"sum",
"of",
"all",
"points",
"in",
"the",
"exterior",
"ring",
"+",
"the",
"total",
"number",
"of",
"points",
"in",
"all",
"the",
"interior",
"rings",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/spatial/geometry/Polygon.java#L130-L141 |
147,221 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/spatial/geometry/Polygon.java | Polygon.getArea | public double getArea() {
double area = 0;
if (!isEmpty()) {
area = exteriorRing.getArea();
if (interiorRings != null) {
for (LinearRing interiorRing : interiorRings) {
area -= interiorRing.getArea();
}
}
}
return area;
} | java | public double getArea() {
double area = 0;
if (!isEmpty()) {
area = exteriorRing.getArea();
if (interiorRings != null) {
for (LinearRing interiorRing : interiorRings) {
area -= interiorRing.getArea();
}
}
}
return area;
} | [
"public",
"double",
"getArea",
"(",
")",
"{",
"double",
"area",
"=",
"0",
";",
"if",
"(",
"!",
"isEmpty",
"(",
")",
")",
"{",
"area",
"=",
"exteriorRing",
".",
"getArea",
"(",
")",
";",
"if",
"(",
"interiorRings",
"!=",
"null",
")",
"{",
"for",
"... | Return the shell area minus holes areas. | [
"Return",
"the",
"shell",
"area",
"minus",
"holes",
"areas",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/spatial/geometry/Polygon.java#L146-L157 |
147,222 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/spatial/geometry/Polygon.java | Polygon.getLength | public double getLength() {
double length = 0;
if (!isEmpty()) {
length = exteriorRing.getLength();
if (interiorRings != null) {
for (LinearRing interiorRing : interiorRings) {
length += interiorRing.getLength();
}
}
}
return length;
} | java | public double getLength() {
double length = 0;
if (!isEmpty()) {
length = exteriorRing.getLength();
if (interiorRings != null) {
for (LinearRing interiorRing : interiorRings) {
length += interiorRing.getLength();
}
}
}
return length;
} | [
"public",
"double",
"getLength",
"(",
")",
"{",
"double",
"length",
"=",
"0",
";",
"if",
"(",
"!",
"isEmpty",
"(",
")",
")",
"{",
"length",
"=",
"exteriorRing",
".",
"getLength",
"(",
")",
";",
"if",
"(",
"interiorRings",
"!=",
"null",
")",
"{",
"f... | Return the total length of all rings. | [
"Return",
"the",
"total",
"length",
"of",
"all",
"rings",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/spatial/geometry/Polygon.java#L162-L173 |
147,223 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/spatial/geometry/Polygon.java | Polygon.getCoordinates | public Coordinate[] getCoordinates() {
if (isEmpty()) {
return null;
}
int len = getNumPoints();
Coordinate[] coordinates = new Coordinate[len];
int count;
for (count = 0; count < exteriorRing.getNumPoints(); count++) {
coordinates[count] = exteriorRing.getCoordinateN(count);
}
if (interiorRings !... | java | public Coordinate[] getCoordinates() {
if (isEmpty()) {
return null;
}
int len = getNumPoints();
Coordinate[] coordinates = new Coordinate[len];
int count;
for (count = 0; count < exteriorRing.getNumPoints(); count++) {
coordinates[count] = exteriorRing.getCoordinateN(count);
}
if (interiorRings !... | [
"public",
"Coordinate",
"[",
"]",
"getCoordinates",
"(",
")",
"{",
"if",
"(",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"int",
"len",
"=",
"getNumPoints",
"(",
")",
";",
"Coordinate",
"[",
"]",
"coordinates",
"=",
"new",
"Coordinate",
... | Return the concatenated coordinates of both the exterior ring and all the interior rings. If the polygon is
empty, null will be returned. | [
"Return",
"the",
"concatenated",
"coordinates",
"of",
"both",
"the",
"exterior",
"ring",
"and",
"all",
"the",
"interior",
"rings",
".",
"If",
"the",
"polygon",
"is",
"empty",
"null",
"will",
"be",
"returned",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/spatial/geometry/Polygon.java#L260-L278 |
147,224 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/spatial/geometry/Polygon.java | Polygon.intersects | public boolean intersects(Geometry geometry) {
if (isEmpty()) {
return false;
}
if (exteriorRing.intersects(geometry)) {
return true;
}
if (interiorRings != null) {
for (LinearRing interiorRing : interiorRings) {
if (interiorRing.intersects(geometry)) {
return true;
}
}
}
return f... | java | public boolean intersects(Geometry geometry) {
if (isEmpty()) {
return false;
}
if (exteriorRing.intersects(geometry)) {
return true;
}
if (interiorRings != null) {
for (LinearRing interiorRing : interiorRings) {
if (interiorRing.intersects(geometry)) {
return true;
}
}
}
return f... | [
"public",
"boolean",
"intersects",
"(",
"Geometry",
"geometry",
")",
"{",
"if",
"(",
"isEmpty",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"exteriorRing",
".",
"intersects",
"(",
"geometry",
")",
")",
"{",
"return",
"true",
";",
"}",
... | Does this polygon intersects with the given geometry?
@param geometry
The other geometry.
@return Returns true of the polygon intersects the other geometry. | [
"Does",
"this",
"polygon",
"intersects",
"with",
"the",
"given",
"geometry?"
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/spatial/geometry/Polygon.java#L291-L306 |
147,225 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/spatial/snapping/Snapper.java | Snapper.snap | public Coordinate snap(Coordinate coordinate) {
if (rules == null || mapModel == null) {
return coordinate;
}
Coordinate snappedCoordinate = coordinate;
double snappedDistance = Double.MAX_VALUE;
for (SnappingRuleInfo rule : rules) {
// Check for supported snapping algorithms: TODO use factory
if (r... | java | public Coordinate snap(Coordinate coordinate) {
if (rules == null || mapModel == null) {
return coordinate;
}
Coordinate snappedCoordinate = coordinate;
double snappedDistance = Double.MAX_VALUE;
for (SnappingRuleInfo rule : rules) {
// Check for supported snapping algorithms: TODO use factory
if (r... | [
"public",
"Coordinate",
"snap",
"(",
"Coordinate",
"coordinate",
")",
"{",
"if",
"(",
"rules",
"==",
"null",
"||",
"mapModel",
"==",
"null",
")",
"{",
"return",
"coordinate",
";",
"}",
"Coordinate",
"snappedCoordinate",
"=",
"coordinate",
";",
"double",
"sna... | Execute the actual snapping!
@param coordinate
The original coordinate that needs snapping.
@return Returns the given coordinate, or a snapped coordinate if one was
found. | [
"Execute",
"the",
"actual",
"snapping!"
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/spatial/snapping/Snapper.java#L134-L181 |
147,226 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/action/toolbar/ToolbarRegistry.java | ToolbarRegistry.getToolbarAction | public static ToolbarBaseAction getToolbarAction(String key, MapWidget mapWidget) {
ToolCreator toolCreator = REGISTRY.get(key);
if (null == toolCreator) {
return null;
}
return toolCreator.createTool(mapWidget);
} | java | public static ToolbarBaseAction getToolbarAction(String key, MapWidget mapWidget) {
ToolCreator toolCreator = REGISTRY.get(key);
if (null == toolCreator) {
return null;
}
return toolCreator.createTool(mapWidget);
} | [
"public",
"static",
"ToolbarBaseAction",
"getToolbarAction",
"(",
"String",
"key",
",",
"MapWidget",
"mapWidget",
")",
"{",
"ToolCreator",
"toolCreator",
"=",
"REGISTRY",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"null",
"==",
"toolCreator",
")",
"{",
"re... | Get the toolbar action which matches the given key.
@param key
key for toolbar action
@param mapWidget
map which will contain this tool
@return toolbar action or null when key not found | [
"Get",
"the",
"toolbar",
"action",
"which",
"matches",
"the",
"given",
"key",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/action/toolbar/ToolbarRegistry.java#L179-L185 |
147,227 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/spatial/geometry/GeometryFactory.java | GeometryFactory.createGeometry | public Geometry createGeometry(Geometry geometry) {
if (geometry instanceof Point) {
return createPoint(geometry.getCoordinate());
} else if (geometry instanceof LinearRing) {
return createLinearRing(geometry.getCoordinates());
} else if (geometry instanceof LineString) {
return createLineString(geometry... | java | public Geometry createGeometry(Geometry geometry) {
if (geometry instanceof Point) {
return createPoint(geometry.getCoordinate());
} else if (geometry instanceof LinearRing) {
return createLinearRing(geometry.getCoordinates());
} else if (geometry instanceof LineString) {
return createLineString(geometry... | [
"public",
"Geometry",
"createGeometry",
"(",
"Geometry",
"geometry",
")",
"{",
"if",
"(",
"geometry",
"instanceof",
"Point",
")",
"{",
"return",
"createPoint",
"(",
"geometry",
".",
"getCoordinate",
"(",
")",
")",
";",
"}",
"else",
"if",
"(",
"geometry",
"... | Create a new geometry from an existing geometry. This will basically create a clone.
@param geometry
The original geometry.
@return Returns a clone. | [
"Create",
"a",
"new",
"geometry",
"from",
"an",
"existing",
"geometry",
".",
"This",
"will",
"basically",
"create",
"a",
"clone",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/spatial/geometry/GeometryFactory.java#L248-L283 |
147,228 | geomajas/geomajas-project-client-gwt | plugin/widget-utility/utility-gwt/src/main/java/org/geomajas/widget/utility/gwt/client/ribbon/RibbonButton.java | RibbonButton.updateGui | protected void updateGui() {
ButtonLayoutStyle buttonButtonLayoutStyle = buttonAction.getButtonLayoutStyle();
if (ButtonLayoutStyle.ICON_TITLE_AND_DESCRIPTION.equals(buttonButtonLayoutStyle)) {
buildGuiWithDescription();
} else { // LayoutParameter.Layout.ICON_AND_TITLE || null || ...
setWidth(50);
if (t... | java | protected void updateGui() {
ButtonLayoutStyle buttonButtonLayoutStyle = buttonAction.getButtonLayoutStyle();
if (ButtonLayoutStyle.ICON_TITLE_AND_DESCRIPTION.equals(buttonButtonLayoutStyle)) {
buildGuiWithDescription();
} else { // LayoutParameter.Layout.ICON_AND_TITLE || null || ...
setWidth(50);
if (t... | [
"protected",
"void",
"updateGui",
"(",
")",
"{",
"ButtonLayoutStyle",
"buttonButtonLayoutStyle",
"=",
"buttonAction",
".",
"getButtonLayoutStyle",
"(",
")",
";",
"if",
"(",
"ButtonLayoutStyle",
".",
"ICON_TITLE_AND_DESCRIPTION",
".",
"equals",
"(",
"buttonButtonLayoutSt... | Update the GUI to reflect the settings. | [
"Update",
"the",
"GUI",
"to",
"reflect",
"the",
"settings",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/plugin/widget-utility/utility-gwt/src/main/java/org/geomajas/widget/utility/gwt/client/ribbon/RibbonButton.java#L293-L330 |
147,229 | seedstack/i18n-addon | rest/src/it/java/org/seedstack/i18n/internal/infrastructure/jpa/KeyJpaFinderIT.java | KeyJpaFinderIT.setUp | @Before
public void setUp() {
defineApplicationLocales();
clearKeys();
List<Key> keys = new ArrayList<>();
keys.add(createKey(KEY_DEFAULT, false, false, false));
Key outdatedKey = createKey(KEY_OUTDATED, false, false, false);
outdatedKey.setOutdated();
keys... | java | @Before
public void setUp() {
defineApplicationLocales();
clearKeys();
List<Key> keys = new ArrayList<>();
keys.add(createKey(KEY_DEFAULT, false, false, false));
Key outdatedKey = createKey(KEY_OUTDATED, false, false, false);
outdatedKey.setOutdated();
keys... | [
"@",
"Before",
"public",
"void",
"setUp",
"(",
")",
"{",
"defineApplicationLocales",
"(",
")",
";",
"clearKeys",
"(",
")",
";",
"List",
"<",
"Key",
">",
"keys",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"keys",
".",
"add",
"(",
"createKey",
"(",
... | Initializes the test. | [
"Initializes",
"the",
"test",
"."
] | 1e65101d8554623f09bda2497b0151fd10a16615 | https://github.com/seedstack/i18n-addon/blob/1e65101d8554623f09bda2497b0151fd10a16615/rest/src/it/java/org/seedstack/i18n/internal/infrastructure/jpa/KeyJpaFinderIT.java#L68-L92 |
147,230 | seedstack/i18n-addon | rest/src/it/java/org/seedstack/i18n/internal/infrastructure/jpa/KeyJpaFinderIT.java | KeyJpaFinderIT.get_missing_default_translation | @Test
public void get_missing_default_translation() {
KeySearchCriteria criteria = new KeySearchCriteria(true, null, null, null);
PaginatedView<KeyRepresentation> keyRepresentations = keyFinder
.findKeysWithTheirDefaultTranslation(FIRST_RANGE, criteria);
assertThat(keyRepres... | java | @Test
public void get_missing_default_translation() {
KeySearchCriteria criteria = new KeySearchCriteria(true, null, null, null);
PaginatedView<KeyRepresentation> keyRepresentations = keyFinder
.findKeysWithTheirDefaultTranslation(FIRST_RANGE, criteria);
assertThat(keyRepres... | [
"@",
"Test",
"public",
"void",
"get_missing_default_translation",
"(",
")",
"{",
"KeySearchCriteria",
"criteria",
"=",
"new",
"KeySearchCriteria",
"(",
"true",
",",
"null",
",",
"null",
",",
"null",
")",
";",
"PaginatedView",
"<",
"KeyRepresentation",
">",
"keyR... | Request all the keys marked as missing. | [
"Request",
"all",
"the",
"keys",
"marked",
"as",
"missing",
"."
] | 1e65101d8554623f09bda2497b0151fd10a16615 | https://github.com/seedstack/i18n-addon/blob/1e65101d8554623f09bda2497b0151fd10a16615/rest/src/it/java/org/seedstack/i18n/internal/infrastructure/jpa/KeyJpaFinderIT.java#L121-L131 |
147,231 | seedstack/i18n-addon | rest/src/it/java/org/seedstack/i18n/internal/infrastructure/jpa/KeyJpaFinderIT.java | KeyJpaFinderIT.get_approx_default_translation | @Test
public void get_approx_default_translation() {
KeySearchCriteria criteria = new KeySearchCriteria(null, true, null, null);
PaginatedView<KeyRepresentation> keyRepresentations = keyFinder
.findKeysWithTheirDefaultTranslation(FIRST_RANGE, criteria);
assertThat(keyReprese... | java | @Test
public void get_approx_default_translation() {
KeySearchCriteria criteria = new KeySearchCriteria(null, true, null, null);
PaginatedView<KeyRepresentation> keyRepresentations = keyFinder
.findKeysWithTheirDefaultTranslation(FIRST_RANGE, criteria);
assertThat(keyReprese... | [
"@",
"Test",
"public",
"void",
"get_approx_default_translation",
"(",
")",
"{",
"KeySearchCriteria",
"criteria",
"=",
"new",
"KeySearchCriteria",
"(",
"null",
",",
"true",
",",
"null",
",",
"null",
")",
";",
"PaginatedView",
"<",
"KeyRepresentation",
">",
"keyRe... | Request all the keys marked as approximate. | [
"Request",
"all",
"the",
"keys",
"marked",
"as",
"approximate",
"."
] | 1e65101d8554623f09bda2497b0151fd10a16615 | https://github.com/seedstack/i18n-addon/blob/1e65101d8554623f09bda2497b0151fd10a16615/rest/src/it/java/org/seedstack/i18n/internal/infrastructure/jpa/KeyJpaFinderIT.java#L136-L147 |
147,232 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/layer/AbstractLayer.java | AbstractLayer.updateShowing | protected void updateShowing(boolean fireEvents) {
double scale = mapModel.getMapView().getCurrentScale();
if (visible) {
boolean oldShowing = showing;
showing = scale >= layerInfo.getMinimumScale().getPixelPerUnit()
&& scale <= layerInfo.getMaximumScale().getPixelPerUnit();
if (oldShowing != showing ... | java | protected void updateShowing(boolean fireEvents) {
double scale = mapModel.getMapView().getCurrentScale();
if (visible) {
boolean oldShowing = showing;
showing = scale >= layerInfo.getMinimumScale().getPixelPerUnit()
&& scale <= layerInfo.getMaximumScale().getPixelPerUnit();
if (oldShowing != showing ... | [
"protected",
"void",
"updateShowing",
"(",
"boolean",
"fireEvents",
")",
"{",
"double",
"scale",
"=",
"mapModel",
".",
"getMapView",
"(",
")",
".",
"getCurrentScale",
"(",
")",
";",
"if",
"(",
"visible",
")",
"{",
"boolean",
"oldShowing",
"=",
"showing",
"... | Update showing state.
@param fireEvents Should events be fired if state changes? | [
"Update",
"showing",
"state",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/layer/AbstractLayer.java#L130-L142 |
147,233 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/layer/AbstractLayer.java | AbstractLayer.setVisible | @Api
public void setVisible(boolean visible) {
if (visible != this.visible) {
this.visible = visible;
updateShowing(false);
handlerManager.fireEvent(new LayerShownEvent(this));
}
} | java | @Api
public void setVisible(boolean visible) {
if (visible != this.visible) {
this.visible = visible;
updateShowing(false);
handlerManager.fireEvent(new LayerShownEvent(this));
}
} | [
"@",
"Api",
"public",
"void",
"setVisible",
"(",
"boolean",
"visible",
")",
"{",
"if",
"(",
"visible",
"!=",
"this",
".",
"visible",
")",
"{",
"this",
".",
"visible",
"=",
"visible",
";",
"updateShowing",
"(",
"false",
")",
";",
"handlerManager",
".",
... | Make the layer visible or invisible.
@param visible
the visible to set
@since 1.10.0 | [
"Make",
"the",
"layer",
"visible",
"or",
"invisible",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/layer/AbstractLayer.java#L268-L275 |
147,234 | geomajas/geomajas-project-client-gwt | plugin/widget-searchandfilter/searchandfilter-gwt/src/main/java/org/geomajas/widget/searchandfilter/client/util/SearchCommService.java | SearchCommService.mergeAndBufferGeometries | public static void mergeAndBufferGeometries(List<Geometry> geometries, double buffer,
final DataCallback<Geometry[]> onFinished) {
GeometryUtilsRequest request = new GeometryUtilsRequest();
request.setActionFlags(GeometryUtilsRequest.ACTION_BUFFER | GeometryUtilsRequest.ACTION_MERGE);
request.setIntermediateRe... | java | public static void mergeAndBufferGeometries(List<Geometry> geometries, double buffer,
final DataCallback<Geometry[]> onFinished) {
GeometryUtilsRequest request = new GeometryUtilsRequest();
request.setActionFlags(GeometryUtilsRequest.ACTION_BUFFER | GeometryUtilsRequest.ACTION_MERGE);
request.setIntermediateRe... | [
"public",
"static",
"void",
"mergeAndBufferGeometries",
"(",
"List",
"<",
"Geometry",
">",
"geometries",
",",
"double",
"buffer",
",",
"final",
"DataCallback",
"<",
"Geometry",
"[",
"]",
">",
"onFinished",
")",
"{",
"GeometryUtilsRequest",
"request",
"=",
"new",... | The returned result will contain a merged-only and a merged and buffered result.
@param geometries geometries
@param buffer buffer size
@param onFinished
callback contains two geometries, one just merged, one buffered | [
"The",
"returned",
"result",
"will",
"contain",
"a",
"merged",
"-",
"only",
"and",
"a",
"merged",
"and",
"buffered",
"result",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/plugin/widget-searchandfilter/searchandfilter-gwt/src/main/java/org/geomajas/widget/searchandfilter/client/util/SearchCommService.java#L75-L95 |
147,235 | geomajas/geomajas-project-client-gwt | plugin/widget-searchandfilter/searchandfilter-gwt/src/main/java/org/geomajas/widget/searchandfilter/client/util/SearchCommService.java | SearchCommService.searchByCriterion | public static void searchByCriterion(final Criterion criterion, final MapWidget mapWidget,
final DataCallback<Map<VectorLayer, List<Feature>>> onFinished, final Runnable onError) {
FeatureSearchRequest request = new FeatureSearchRequest();
request.setMapCrs(mapWidget.getMapModel().getCrs());
request.setCriteri... | java | public static void searchByCriterion(final Criterion criterion, final MapWidget mapWidget,
final DataCallback<Map<VectorLayer, List<Feature>>> onFinished, final Runnable onError) {
FeatureSearchRequest request = new FeatureSearchRequest();
request.setMapCrs(mapWidget.getMapModel().getCrs());
request.setCriteri... | [
"public",
"static",
"void",
"searchByCriterion",
"(",
"final",
"Criterion",
"criterion",
",",
"final",
"MapWidget",
"mapWidget",
",",
"final",
"DataCallback",
"<",
"Map",
"<",
"VectorLayer",
",",
"List",
"<",
"Feature",
">",
">",
">",
"onFinished",
",",
"final... | Execute a search by criterion command.
@param criterion criterion
@param mapWidget map widget
@param onFinished callback
@param onError
callback to execute in case of error, optional use null if you
don't need it | [
"Execute",
"a",
"search",
"by",
"criterion",
"command",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/plugin/widget-searchandfilter/searchandfilter-gwt/src/main/java/org/geomajas/widget/searchandfilter/client/util/SearchCommService.java#L197-L223 |
147,236 | geomajas/geomajas-project-client-gwt | plugin/widget-searchandfilter/searchandfilter-gwt/src/main/java/org/geomajas/widget/searchandfilter/client/util/SearchCommService.java | SearchCommService.getLayerFiltersForCriterion | public static Map<String, String> getLayerFiltersForCriterion(Criterion critter, MapModel mapModel) {
Map<String, String> filters = new HashMap<String, String>();
Set<String> serverLayerIds = new HashSet<String>();
critter.serverLayerIdVisitor(serverLayerIds);
for (VectorLayer vectorLayer : mapModel.getVectorL... | java | public static Map<String, String> getLayerFiltersForCriterion(Criterion critter, MapModel mapModel) {
Map<String, String> filters = new HashMap<String, String>();
Set<String> serverLayerIds = new HashSet<String>();
critter.serverLayerIdVisitor(serverLayerIds);
for (VectorLayer vectorLayer : mapModel.getVectorL... | [
"public",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"getLayerFiltersForCriterion",
"(",
"Criterion",
"critter",
",",
"MapModel",
"mapModel",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"filters",
"=",
"new",
"HashMap",
"<",
"String",
",",
... | Builds a map with the filters for all layers that are used in the given criterion.
@param critter criterion
@param mapModel map model
@return filters for all layers | [
"Builds",
"a",
"map",
"with",
"the",
"filters",
"for",
"all",
"layers",
"that",
"are",
"used",
"in",
"the",
"given",
"criterion",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/plugin/widget-searchandfilter/searchandfilter-gwt/src/main/java/org/geomajas/widget/searchandfilter/client/util/SearchCommService.java#L232-L245 |
147,237 | geomajas/geomajas-project-client-gwt | plugin/widget-searchandfilter/searchandfilter-gwt/src/main/java/org/geomajas/widget/searchandfilter/client/util/SearchCommService.java | SearchCommService.convertFromDto | private static Map<VectorLayer, List<Feature>> convertFromDto(
Map<String, List<org.geomajas.layer.feature.Feature>> dtoFeatures, MapModel model) {
Map<VectorLayer, List<Feature>> result = new LinkedHashMap<VectorLayer, List<Feature>>();
for (Entry<String, List<org.geomajas.layer.feature.Feature>> entry : dtoFea... | java | private static Map<VectorLayer, List<Feature>> convertFromDto(
Map<String, List<org.geomajas.layer.feature.Feature>> dtoFeatures, MapModel model) {
Map<VectorLayer, List<Feature>> result = new LinkedHashMap<VectorLayer, List<Feature>>();
for (Entry<String, List<org.geomajas.layer.feature.Feature>> entry : dtoFea... | [
"private",
"static",
"Map",
"<",
"VectorLayer",
",",
"List",
"<",
"Feature",
">",
">",
"convertFromDto",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"org",
".",
"geomajas",
".",
"layer",
".",
"feature",
".",
"Feature",
">",
">",
"dtoFeatures",
",",
"M... | This also adds the features to their respective layers, so no need to do
that anymore.
@param dtoFeatures DTOPs for features
@param model map model
@return client features | [
"This",
"also",
"adds",
"the",
"features",
"to",
"their",
"respective",
"layers",
"so",
"no",
"need",
"to",
"do",
"that",
"anymore",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/plugin/widget-searchandfilter/searchandfilter-gwt/src/main/java/org/geomajas/widget/searchandfilter/client/util/SearchCommService.java#L257-L273 |
147,238 | geomajas/geomajas-project-client-gwt | plugin/print/print-gwt/src/main/java/org/geomajas/plugin/printing/client/util/UrlBuilder.java | UrlBuilder.addPath | public UrlBuilder addPath(String path) {
if (path.charAt(0) == '/' && baseUrl.endsWith("/")) {
baseUrl = baseUrl + path.substring(1);
} else {
baseUrl = baseUrl + path;
}
return this;
} | java | public UrlBuilder addPath(String path) {
if (path.charAt(0) == '/' && baseUrl.endsWith("/")) {
baseUrl = baseUrl + path.substring(1);
} else {
baseUrl = baseUrl + path;
}
return this;
} | [
"public",
"UrlBuilder",
"addPath",
"(",
"String",
"path",
")",
"{",
"if",
"(",
"path",
".",
"charAt",
"(",
"0",
")",
"==",
"'",
"'",
"&&",
"baseUrl",
".",
"endsWith",
"(",
"\"/\"",
")",
")",
"{",
"baseUrl",
"=",
"baseUrl",
"+",
"path",
".",
"substr... | Add a path extension.
@param path
path
@return this to allow concatenation | [
"Add",
"a",
"path",
"extension",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/plugin/print/print-gwt/src/main/java/org/geomajas/plugin/printing/client/util/UrlBuilder.java#L59-L66 |
147,239 | seedstack/i18n-addon | rest/src/main/java/org/seedstack/i18n/rest/internal/locale/AvailableLocalesResource.java | AvailableLocalesResource.getAvailableLocales | @GET
@Produces(MediaType.APPLICATION_JSON)
@RequiresPermissions(I18nPermissions.LOCALE_READ)
public Response getAvailableLocales() {
List<LocaleRepresentation> availableLocales = localeFinder.findAvailableLocales();
if (!availableLocales.isEmpty()) {
return Response.ok(availableL... | java | @GET
@Produces(MediaType.APPLICATION_JSON)
@RequiresPermissions(I18nPermissions.LOCALE_READ)
public Response getAvailableLocales() {
List<LocaleRepresentation> availableLocales = localeFinder.findAvailableLocales();
if (!availableLocales.isEmpty()) {
return Response.ok(availableL... | [
"@",
"GET",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"RequiresPermissions",
"(",
"I18nPermissions",
".",
"LOCALE_READ",
")",
"public",
"Response",
"getAvailableLocales",
"(",
")",
"{",
"List",
"<",
"LocaleRepresentation",
">",
"availab... | Gets all the locales available in the application.
@return list of locale representation or 204 (no content) | [
"Gets",
"all",
"the",
"locales",
"available",
"in",
"the",
"application",
"."
] | 1e65101d8554623f09bda2497b0151fd10a16615 | https://github.com/seedstack/i18n-addon/blob/1e65101d8554623f09bda2497b0151fd10a16615/rest/src/main/java/org/seedstack/i18n/rest/internal/locale/AvailableLocalesResource.java#L68-L77 |
147,240 | seedstack/i18n-addon | rest/src/main/java/org/seedstack/i18n/rest/internal/locale/AvailableLocalesResource.java | AvailableLocalesResource.getAvailableLocale | @GET
@Path("/{localeId}")
@Produces(MediaType.APPLICATION_JSON)
@RequiresPermissions(I18nPermissions.LOCALE_READ)
public Response getAvailableLocale(@PathParam("localeId") String localeId) {
WebAssertions.assertNotBlank(localeId, LOCALE_SHOULD_NOT_BE_BLANK);
LocaleRepresentation availabl... | java | @GET
@Path("/{localeId}")
@Produces(MediaType.APPLICATION_JSON)
@RequiresPermissions(I18nPermissions.LOCALE_READ)
public Response getAvailableLocale(@PathParam("localeId") String localeId) {
WebAssertions.assertNotBlank(localeId, LOCALE_SHOULD_NOT_BE_BLANK);
LocaleRepresentation availabl... | [
"@",
"GET",
"@",
"Path",
"(",
"\"/{localeId}\"",
")",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"RequiresPermissions",
"(",
"I18nPermissions",
".",
"LOCALE_READ",
")",
"public",
"Response",
"getAvailableLocale",
"(",
"@",
"PathParam",
... | Gets the requested locale, if it is available in the application.
@param localeId locale code
@return http status code 200 (ok) with the locale or 404 if the locale is not available. | [
"Gets",
"the",
"requested",
"locale",
"if",
"it",
"is",
"available",
"in",
"the",
"application",
"."
] | 1e65101d8554623f09bda2497b0151fd10a16615 | https://github.com/seedstack/i18n-addon/blob/1e65101d8554623f09bda2497b0151fd10a16615/rest/src/main/java/org/seedstack/i18n/rest/internal/locale/AvailableLocalesResource.java#L85-L96 |
147,241 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/MapViewState.java | MapViewState.isPannableFrom | public boolean isPannableFrom(MapViewState other) {
return Math.abs(scale - other.getScale()) < EQUAL_CHECK_DELTA
&& Math.abs(getPanX() - other.getPanX()) < EQUAL_CHECK_DELTA
&& Math.abs(getPanY() - other.getPanY()) < EQUAL_CHECK_DELTA;
} | java | public boolean isPannableFrom(MapViewState other) {
return Math.abs(scale - other.getScale()) < EQUAL_CHECK_DELTA
&& Math.abs(getPanX() - other.getPanX()) < EQUAL_CHECK_DELTA
&& Math.abs(getPanY() - other.getPanY()) < EQUAL_CHECK_DELTA;
} | [
"public",
"boolean",
"isPannableFrom",
"(",
"MapViewState",
"other",
")",
"{",
"return",
"Math",
".",
"abs",
"(",
"scale",
"-",
"other",
".",
"getScale",
"(",
")",
")",
"<",
"EQUAL_CHECK_DELTA",
"&&",
"Math",
".",
"abs",
"(",
"getPanX",
"(",
")",
"-",
... | Can this view state be reached by panning from another view state ?
@param viewState the view state to compare with
@return true if reachable by panning | [
"Can",
"this",
"view",
"state",
"be",
"reached",
"by",
"panning",
"from",
"another",
"view",
"state",
"?"
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/MapViewState.java#L97-L101 |
147,242 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/layer/RasterLayer.java | RasterLayer.setOpacity | public void setOpacity(double opacity) {
getLayerInfo().setStyle(Double.toString(opacity));
handlerManager.fireEvent(new LayerStyleChangeEvent(this));
} | java | public void setOpacity(double opacity) {
getLayerInfo().setStyle(Double.toString(opacity));
handlerManager.fireEvent(new LayerStyleChangeEvent(this));
} | [
"public",
"void",
"setOpacity",
"(",
"double",
"opacity",
")",
"{",
"getLayerInfo",
"(",
")",
".",
"setStyle",
"(",
"Double",
".",
"toString",
"(",
"opacity",
")",
")",
";",
"handlerManager",
".",
"fireEvent",
"(",
"new",
"LayerStyleChangeEvent",
"(",
"this"... | Apply a new opacity on the entire raster layer.
@param opacity The new opacity value. Must be a value between 0 and 1, where 0 means invisible and 1 is totally
visible.
@since 1.8.0 | [
"Apply",
"a",
"new",
"opacity",
"on",
"the",
"entire",
"raster",
"layer",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/layer/RasterLayer.java#L81-L84 |
147,243 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/spatial/WorldViewTransformer.java | WorldViewTransformer.viewToPan | public Coordinate viewToPan(Coordinate coordinate) {
if (coordinate != null) {
Vector2D position = new Vector2D(coordinate);
double scale = mapView.getCurrentScale();
Coordinate panOrigin = mapView.getPanOrigin();
double translateX = (mapView.getViewState().getX() - panOrigin.getX()) * scale - (mapVie... | java | public Coordinate viewToPan(Coordinate coordinate) {
if (coordinate != null) {
Vector2D position = new Vector2D(coordinate);
double scale = mapView.getCurrentScale();
Coordinate panOrigin = mapView.getPanOrigin();
double translateX = (mapView.getViewState().getX() - panOrigin.getX()) * scale - (mapVie... | [
"public",
"Coordinate",
"viewToPan",
"(",
"Coordinate",
"coordinate",
")",
"{",
"if",
"(",
"coordinate",
"!=",
"null",
")",
"{",
"Vector2D",
"position",
"=",
"new",
"Vector2D",
"(",
"coordinate",
")",
";",
"double",
"scale",
"=",
"mapView",
".",
"getCurrentS... | Transform a coordinate from view space to pan space.
@param coordinate
The views pace coordinate.
@return Returns the pan space equivalent of the given coordinate. | [
"Transform",
"a",
"coordinate",
"from",
"view",
"space",
"to",
"pan",
"space",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/spatial/WorldViewTransformer.java#L234-L247 |
147,244 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/spatial/WorldViewTransformer.java | WorldViewTransformer.viewToWorld | public Coordinate viewToWorld(Coordinate coordinate) {
if (coordinate != null) {
Vector2D position = new Vector2D(coordinate);
double inverseScale = 1 / mapView.getCurrentScale();
position.scale(inverseScale, -inverseScale);
Bbox bounds = mapView.getBounds();
// -cam: center X axis around cam. +bbox.w... | java | public Coordinate viewToWorld(Coordinate coordinate) {
if (coordinate != null) {
Vector2D position = new Vector2D(coordinate);
double inverseScale = 1 / mapView.getCurrentScale();
position.scale(inverseScale, -inverseScale);
Bbox bounds = mapView.getBounds();
// -cam: center X axis around cam. +bbox.w... | [
"public",
"Coordinate",
"viewToWorld",
"(",
"Coordinate",
"coordinate",
")",
"{",
"if",
"(",
"coordinate",
"!=",
"null",
")",
"{",
"Vector2D",
"position",
"=",
"new",
"Vector2D",
"(",
"coordinate",
")",
";",
"double",
"inverseScale",
"=",
"1",
"/",
"mapView"... | Transform a coordinate from view space to world space.
@param coordinate
The views pace coordinate.
@return Returns the world space equivalent of the given coordinate. | [
"Transform",
"a",
"coordinate",
"from",
"view",
"space",
"to",
"world",
"space",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/spatial/WorldViewTransformer.java#L315-L330 |
147,245 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/paintable/mapaddon/MapAddon.java | MapAddon.setMapSize | public void setMapSize(int mapWidth, int mapHeight) {
double x = horizontalMargin;
double y = verticalMargin;
// Calculate horizontal position:
switch (alignment) {
case LEFT:
break;
case CENTER:
x = Math.round((mapWidth - width) / 2);
break;
case RIGHT:
x = mapWidth - width - horizont... | java | public void setMapSize(int mapWidth, int mapHeight) {
double x = horizontalMargin;
double y = verticalMargin;
// Calculate horizontal position:
switch (alignment) {
case LEFT:
break;
case CENTER:
x = Math.round((mapWidth - width) / 2);
break;
case RIGHT:
x = mapWidth - width - horizont... | [
"public",
"void",
"setMapSize",
"(",
"int",
"mapWidth",
",",
"int",
"mapHeight",
")",
"{",
"double",
"x",
"=",
"horizontalMargin",
";",
"double",
"y",
"=",
"verticalMargin",
";",
"// Calculate horizontal position:",
"switch",
"(",
"alignment",
")",
"{",
"case",
... | Apply a new width and height for the map onto whom this add-on is drawn. This method is triggered automatically
when the map resizes.
@param mapWidth
The map's new width.
@param mapHeight
The map's new height. | [
"Apply",
"a",
"new",
"width",
"and",
"height",
"for",
"the",
"map",
"onto",
"whom",
"this",
"add",
"-",
"on",
"is",
"drawn",
".",
"This",
"method",
"is",
"triggered",
"automatically",
"when",
"the",
"map",
"resizes",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/paintable/mapaddon/MapAddon.java#L99-L126 |
147,246 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/spatial/Mathlib.java | Mathlib.lineIntersects | public static boolean lineIntersects(Coordinate c1, Coordinate c2, Coordinate c3, Coordinate c4) {
LineSegment ls1 = new LineSegment(c1, c2);
LineSegment ls2 = new LineSegment(c3, c4);
return ls1.intersects(ls2);
} | java | public static boolean lineIntersects(Coordinate c1, Coordinate c2, Coordinate c3, Coordinate c4) {
LineSegment ls1 = new LineSegment(c1, c2);
LineSegment ls2 = new LineSegment(c3, c4);
return ls1.intersects(ls2);
} | [
"public",
"static",
"boolean",
"lineIntersects",
"(",
"Coordinate",
"c1",
",",
"Coordinate",
"c2",
",",
"Coordinate",
"c3",
",",
"Coordinate",
"c4",
")",
"{",
"LineSegment",
"ls1",
"=",
"new",
"LineSegment",
"(",
"c1",
",",
"c2",
")",
";",
"LineSegment",
"... | Calculates whether or not 2 line-segments intersect.
@param c1
First coordinate of the first line-segment.
@param c2
Second coordinate of the first line-segment.
@param c3
First coordinate of the second line-segment.
@param c4
Second coordinate of the second line-segment.
@return Returns true or false. | [
"Calculates",
"whether",
"or",
"not",
"2",
"line",
"-",
"segments",
"intersect",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/spatial/Mathlib.java#L45-L49 |
147,247 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/spatial/Mathlib.java | Mathlib.lineSegmentIntersection | public Coordinate lineSegmentIntersection(Coordinate c1, Coordinate c2, Coordinate c3, Coordinate c4) {
LineSegment ls1 = new LineSegment(c1, c2);
LineSegment ls2 = new LineSegment(c3, c4);
return ls1.getIntersectionSegments(ls2);
} | java | public Coordinate lineSegmentIntersection(Coordinate c1, Coordinate c2, Coordinate c3, Coordinate c4) {
LineSegment ls1 = new LineSegment(c1, c2);
LineSegment ls2 = new LineSegment(c3, c4);
return ls1.getIntersectionSegments(ls2);
} | [
"public",
"Coordinate",
"lineSegmentIntersection",
"(",
"Coordinate",
"c1",
",",
"Coordinate",
"c2",
",",
"Coordinate",
"c3",
",",
"Coordinate",
"c4",
")",
"{",
"LineSegment",
"ls1",
"=",
"new",
"LineSegment",
"(",
"c1",
",",
"c2",
")",
";",
"LineSegment",
"... | Calculates the intersection point of 2 line segments.
@param c1
Start point of the first line segment.
@param c2
End point of the first line segment.
@param c3
Start point of the second line segment.
@param c4
End point of the second line segment.
@return Returns a coordinate or null if not a single intersection point... | [
"Calculates",
"the",
"intersection",
"point",
"of",
"2",
"line",
"segments",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/spatial/Mathlib.java#L83-L87 |
147,248 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/spatial/Mathlib.java | Mathlib.distance | public static double distance(Coordinate c1, Coordinate c2, Coordinate c3) {
LineSegment ls = new LineSegment(c1, c2);
return ls.distance(c3);
} | java | public static double distance(Coordinate c1, Coordinate c2, Coordinate c3) {
LineSegment ls = new LineSegment(c1, c2);
return ls.distance(c3);
} | [
"public",
"static",
"double",
"distance",
"(",
"Coordinate",
"c1",
",",
"Coordinate",
"c2",
",",
"Coordinate",
"c3",
")",
"{",
"LineSegment",
"ls",
"=",
"new",
"LineSegment",
"(",
"c1",
",",
"c2",
")",
";",
"return",
"ls",
".",
"distance",
"(",
"c3",
"... | Distance between a point and a line.
@param c1
First coordinate of the line.
@param c2
Second coordinate of the line.
@param c3
Coordinate to calculate distance to line from. | [
"Distance",
"between",
"a",
"point",
"and",
"a",
"line",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/spatial/Mathlib.java#L113-L116 |
147,249 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/MapView.java | MapView.getWorldToViewTransformation | public Matrix getWorldToViewTransformation() {
if (viewState.getScale() > 0) {
double dX = -(viewState.getX() * viewState.getScale()) + width / 2;
double dY = viewState.getY() * viewState.getScale() + height / 2;
return new Matrix(viewState.getScale(), 0, 0, -viewState.getScale(), dX, dY);
}
return new M... | java | public Matrix getWorldToViewTransformation() {
if (viewState.getScale() > 0) {
double dX = -(viewState.getX() * viewState.getScale()) + width / 2;
double dY = viewState.getY() * viewState.getScale() + height / 2;
return new Matrix(viewState.getScale(), 0, 0, -viewState.getScale(), dX, dY);
}
return new M... | [
"public",
"Matrix",
"getWorldToViewTransformation",
"(",
")",
"{",
"if",
"(",
"viewState",
".",
"getScale",
"(",
")",
">",
"0",
")",
"{",
"double",
"dX",
"=",
"-",
"(",
"viewState",
".",
"getX",
"(",
")",
"*",
"viewState",
".",
"getScale",
"(",
")",
... | Return the world-to-view space transformation matrix.
@return transformation matrix | [
"Return",
"the",
"world",
"-",
"to",
"-",
"view",
"space",
"transformation",
"matrix",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/MapView.java#L141-L148 |
147,250 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/MapView.java | MapView.getWorldToPanTransformation | public Matrix getWorldToPanTransformation() {
if (viewState.getScale() > 0) {
double dX = -(viewState.getPanX() * viewState.getScale());
double dY = viewState.getPanY() * viewState.getScale();
return new Matrix(viewState.getScale(), 0, 0, -viewState.getScale(), dX, dY);
}
return new Matrix(1, 0, 0, 1, 0,... | java | public Matrix getWorldToPanTransformation() {
if (viewState.getScale() > 0) {
double dX = -(viewState.getPanX() * viewState.getScale());
double dY = viewState.getPanY() * viewState.getScale();
return new Matrix(viewState.getScale(), 0, 0, -viewState.getScale(), dX, dY);
}
return new Matrix(1, 0, 0, 1, 0,... | [
"public",
"Matrix",
"getWorldToPanTransformation",
"(",
")",
"{",
"if",
"(",
"viewState",
".",
"getScale",
"(",
")",
">",
"0",
")",
"{",
"double",
"dX",
"=",
"-",
"(",
"viewState",
".",
"getPanX",
"(",
")",
"*",
"viewState",
".",
"getScale",
"(",
")",
... | Return the world-to-pan space translation matrix.
@return transformation matrix | [
"Return",
"the",
"world",
"-",
"to",
"-",
"pan",
"space",
"translation",
"matrix",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/MapView.java#L169-L176 |
147,251 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/MapView.java | MapView.getPanToViewTranslation | public Matrix getPanToViewTranslation() {
if (viewState.getScale() > 0) {
double dX = -((viewState.getX() - viewState.getPanX()) * viewState.getScale()) + width / 2;
double dY = (viewState.getY() - viewState.getPanY()) * viewState.getScale() + height / 2;
return new Matrix(1, 0, 0, 1, dX, dY);
}
return n... | java | public Matrix getPanToViewTranslation() {
if (viewState.getScale() > 0) {
double dX = -((viewState.getX() - viewState.getPanX()) * viewState.getScale()) + width / 2;
double dY = (viewState.getY() - viewState.getPanY()) * viewState.getScale() + height / 2;
return new Matrix(1, 0, 0, 1, dX, dY);
}
return n... | [
"public",
"Matrix",
"getPanToViewTranslation",
"(",
")",
"{",
"if",
"(",
"viewState",
".",
"getScale",
"(",
")",
">",
"0",
")",
"{",
"double",
"dX",
"=",
"-",
"(",
"(",
"viewState",
".",
"getX",
"(",
")",
"-",
"viewState",
".",
"getPanX",
"(",
")",
... | Return the translation of coordinates relative to the pan origin to view coordinates.
@return transformation matrix | [
"Return",
"the",
"translation",
"of",
"coordinates",
"relative",
"to",
"the",
"pan",
"origin",
"to",
"view",
"coordinates",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/MapView.java#L183-L190 |
147,252 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/MapView.java | MapView.getWorldToPanTranslation | public Matrix getWorldToPanTranslation() {
if (viewState.getScale() > 0) {
double dX = -(viewState.getPanX() * viewState.getScale());
double dY = viewState.getPanY() * viewState.getScale();
return new Matrix(1, 0, 0, 1, dX, dY);
}
return new Matrix(1, 0, 0, 1, 0, 0);
} | java | public Matrix getWorldToPanTranslation() {
if (viewState.getScale() > 0) {
double dX = -(viewState.getPanX() * viewState.getScale());
double dY = viewState.getPanY() * viewState.getScale();
return new Matrix(1, 0, 0, 1, dX, dY);
}
return new Matrix(1, 0, 0, 1, 0, 0);
} | [
"public",
"Matrix",
"getWorldToPanTranslation",
"(",
")",
"{",
"if",
"(",
"viewState",
".",
"getScale",
"(",
")",
">",
"0",
")",
"{",
"double",
"dX",
"=",
"-",
"(",
"viewState",
".",
"getPanX",
"(",
")",
"*",
"viewState",
".",
"getScale",
"(",
")",
"... | Return the translation of scaled world coordinates to coordinates relative to the pan origin.
@return transformation matrix | [
"Return",
"the",
"translation",
"of",
"scaled",
"world",
"coordinates",
"to",
"coordinates",
"relative",
"to",
"the",
"pan",
"origin",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/MapView.java#L197-L204 |
147,253 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/MapView.java | MapView.getWorldToViewScaling | public Matrix getWorldToViewScaling() {
if (viewState.getScale() > 0) {
return new Matrix(viewState.getScale(), 0, 0, -viewState.getScale(), 0, 0);
}
return new Matrix(1, 0, 0, 1, 0, 0);
} | java | public Matrix getWorldToViewScaling() {
if (viewState.getScale() > 0) {
return new Matrix(viewState.getScale(), 0, 0, -viewState.getScale(), 0, 0);
}
return new Matrix(1, 0, 0, 1, 0, 0);
} | [
"public",
"Matrix",
"getWorldToViewScaling",
"(",
")",
"{",
"if",
"(",
"viewState",
".",
"getScale",
"(",
")",
">",
"0",
")",
"{",
"return",
"new",
"Matrix",
"(",
"viewState",
".",
"getScale",
"(",
")",
",",
"0",
",",
"0",
",",
"-",
"viewState",
".",... | Return the world-to-view space translation matrix.
@return transformation matrix | [
"Return",
"the",
"world",
"-",
"to",
"-",
"view",
"space",
"translation",
"matrix",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/MapView.java#L211-L216 |
147,254 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/MapView.java | MapView.setSize | public void setSize(int newWidth, int newHeight) {
saveState();
Bbox bbox = getBounds();
if (width != newWidth || height != newHeight) {
this.width = newWidth;
this.height = newHeight;
if (viewState.getScale() < getMinimumScale()) {
// The new scale is too low, re-apply old values:
double scale =... | java | public void setSize(int newWidth, int newHeight) {
saveState();
Bbox bbox = getBounds();
if (width != newWidth || height != newHeight) {
this.width = newWidth;
this.height = newHeight;
if (viewState.getScale() < getMinimumScale()) {
// The new scale is too low, re-apply old values:
double scale =... | [
"public",
"void",
"setSize",
"(",
"int",
"newWidth",
",",
"int",
"newHeight",
")",
"{",
"saveState",
"(",
")",
";",
"Bbox",
"bbox",
"=",
"getBounds",
"(",
")",
";",
"if",
"(",
"width",
"!=",
"newWidth",
"||",
"height",
"!=",
"newHeight",
")",
"{",
"t... | Set the size of the map in pixels.
@param newWidth
The map's width.
@param newHeight
The map's height. | [
"Set",
"the",
"size",
"of",
"the",
"map",
"in",
"pixels",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/MapView.java#L306-L321 |
147,255 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/MapView.java | MapView.translate | public void translate(double x, double y) {
saveState();
doSetOrigin(new Coordinate(viewState.getX() + x, viewState.getY() + y));
fireEvent(false, null);
} | java | public void translate(double x, double y) {
saveState();
doSetOrigin(new Coordinate(viewState.getX() + x, viewState.getY() + y));
fireEvent(false, null);
} | [
"public",
"void",
"translate",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"saveState",
"(",
")",
";",
"doSetOrigin",
"(",
"new",
"Coordinate",
"(",
"viewState",
".",
"getX",
"(",
")",
"+",
"x",
",",
"viewState",
".",
"getY",
"(",
")",
"+",
"... | Move the view on the map. This happens by translating the camera in turn.
@param x
Translation factor along the X-axis in world space.
@param y
Translation factor along the Y-axis in world space. | [
"Move",
"the",
"view",
"on",
"the",
"map",
".",
"This",
"happens",
"by",
"translating",
"the",
"camera",
"in",
"turn",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/MapView.java#L331-L335 |
147,256 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/MapView.java | MapView.scale | public void scale(double delta, ZoomOption option, Coordinate center) {
setCurrentScale(viewState.getScale() * delta, option, center);
} | java | public void scale(double delta, ZoomOption option, Coordinate center) {
setCurrentScale(viewState.getScale() * delta, option, center);
} | [
"public",
"void",
"scale",
"(",
"double",
"delta",
",",
"ZoomOption",
"option",
",",
"Coordinate",
"center",
")",
"{",
"setCurrentScale",
"(",
"viewState",
".",
"getScale",
"(",
")",
"*",
"delta",
",",
"option",
",",
"center",
")",
";",
"}"
] | Adjust the current scale on the map by a new factor, keeping a coordinate in place.
@param delta Adjust the scale by factor "delta".
@param option zoom option
@param center Keep this coordinate on the same position as before. | [
"Adjust",
"the",
"current",
"scale",
"on",
"the",
"map",
"by",
"a",
"new",
"factor",
"keeping",
"a",
"coordinate",
"in",
"place",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/MapView.java#L354-L356 |
147,257 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/MapView.java | MapView.getBounds | public Bbox getBounds() {
double w = getViewSpaceWidth();
double h = getViewSpaceHeight();
double x = viewState.getX() - w / 2;
double y = viewState.getY() - h / 2;
return new Bbox(x, y, w, h);
} | java | public Bbox getBounds() {
double w = getViewSpaceWidth();
double h = getViewSpaceHeight();
double x = viewState.getX() - w / 2;
double y = viewState.getY() - h / 2;
return new Bbox(x, y, w, h);
} | [
"public",
"Bbox",
"getBounds",
"(",
")",
"{",
"double",
"w",
"=",
"getViewSpaceWidth",
"(",
")",
";",
"double",
"h",
"=",
"getViewSpaceHeight",
"(",
")",
";",
"double",
"x",
"=",
"viewState",
".",
"getX",
"(",
")",
"-",
"w",
"/",
"2",
";",
"double",
... | Given the information in this MapView object, what is the currently visible area?
@return Notice that at this moment an Axis Aligned Bounding Box is returned! This means that rotating is not yet
possible. | [
"Given",
"the",
"information",
"in",
"this",
"MapView",
"object",
"what",
"is",
"the",
"currently",
"visible",
"area?"
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/MapView.java#L377-L383 |
147,258 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/MapView.java | MapView.fireEvent | private void fireEvent(boolean resized, ZoomOption option) {
if (width > 0) {
// keep old semantics of sameScaleLevel for api compatibility !
boolean sameScale = lastViewState != null && viewState.isPannableFrom(lastViewState);
handlerManager.fireEvent(new MapViewChangedEvent(getBounds(), getCurrentScale(), ... | java | private void fireEvent(boolean resized, ZoomOption option) {
if (width > 0) {
// keep old semantics of sameScaleLevel for api compatibility !
boolean sameScale = lastViewState != null && viewState.isPannableFrom(lastViewState);
handlerManager.fireEvent(new MapViewChangedEvent(getBounds(), getCurrentScale(), ... | [
"private",
"void",
"fireEvent",
"(",
"boolean",
"resized",
",",
"ZoomOption",
"option",
")",
"{",
"if",
"(",
"width",
">",
"0",
")",
"{",
"// keep old semantics of sameScaleLevel for api compatibility !",
"boolean",
"sameScale",
"=",
"lastViewState",
"!=",
"null",
"... | Fire an event.
@param resized resized or not
@param option zoom option | [
"Fire",
"an",
"event",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/MapView.java#L630-L637 |
147,259 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/MapView.java | MapView.snapToResolution | private double snapToResolution(double scale, ZoomOption option) {
// clip upper bounds
double allowedScale = limitScale(scale);
if (resolutions != null) {
IndexRange indices = getResolutionRange();
if (option == ZoomOption.EXACT || !indices.isValid()) {
// should not or cannot snap to resolutions
r... | java | private double snapToResolution(double scale, ZoomOption option) {
// clip upper bounds
double allowedScale = limitScale(scale);
if (resolutions != null) {
IndexRange indices = getResolutionRange();
if (option == ZoomOption.EXACT || !indices.isValid()) {
// should not or cannot snap to resolutions
r... | [
"private",
"double",
"snapToResolution",
"(",
"double",
"scale",
",",
"ZoomOption",
"option",
")",
"{",
"// clip upper bounds",
"double",
"allowedScale",
"=",
"limitScale",
"(",
"scale",
")",
";",
"if",
"(",
"resolutions",
"!=",
"null",
")",
"{",
"IndexRange",
... | Finds an optimal scale by snapping to resolutions.
@param scale
scale which needs to be snapped
@param option
snapping option
@return snapped scale | [
"Finds",
"an",
"optimal",
"scale",
"by",
"snapping",
"to",
"resolutions",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/MapView.java#L648-L698 |
147,260 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/MapView.java | MapView.calcCenterFromPoint | private Coordinate calcCenterFromPoint(final Coordinate worldCenter) {
double xCenter = worldCenter.getX();
double yCenter = worldCenter.getY();
if (maxBounds != null) {
Coordinate minCoordinate = maxBounds.getOrigin();
Coordinate maxCoordinate = maxBounds.getEndPoint();
if (BoundsLimitOption.COMPLETELY... | java | private Coordinate calcCenterFromPoint(final Coordinate worldCenter) {
double xCenter = worldCenter.getX();
double yCenter = worldCenter.getY();
if (maxBounds != null) {
Coordinate minCoordinate = maxBounds.getOrigin();
Coordinate maxCoordinate = maxBounds.getEndPoint();
if (BoundsLimitOption.COMPLETELY... | [
"private",
"Coordinate",
"calcCenterFromPoint",
"(",
"final",
"Coordinate",
"worldCenter",
")",
"{",
"double",
"xCenter",
"=",
"worldCenter",
".",
"getX",
"(",
")",
";",
"double",
"yCenter",
"=",
"worldCenter",
".",
"getY",
"(",
")",
";",
"if",
"(",
"maxBoun... | Adjusts the center point of the map, to an allowed center point. This method tries to make sure the whole map
extent is inside the maximum allowed bounds.
@param worldCenter world center
@return new center | [
"Adjusts",
"the",
"center",
"point",
"of",
"the",
"map",
"to",
"an",
"allowed",
"center",
"point",
".",
"This",
"method",
"tries",
"to",
"make",
"sure",
"the",
"whole",
"map",
"extent",
"is",
"inside",
"the",
"maximum",
"allowed",
"bounds",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/MapView.java#L707-L757 |
147,261 | geomajas/geomajas-project-client-gwt | plugin/widget-searchandfilter/searchandfilter-gwt/src/main/java/org/geomajas/widget/searchandfilter/client/widget/searchfavourites/SearchFavouritesListPanel.java | SearchFavouritesListPanel.initializeList | private void initializeList() {
FavouritesCommService.getSearchFavourites(new DataCallback<List<SearchFavourite>>() {
public void execute(List<SearchFavourite> result) {
favouriteItems.getDataAsRecordList().removeList(favouriteItems.getRecords());
for (SearchFavourite sf : result) {
favouriteItems.add... | java | private void initializeList() {
FavouritesCommService.getSearchFavourites(new DataCallback<List<SearchFavourite>>() {
public void execute(List<SearchFavourite> result) {
favouriteItems.getDataAsRecordList().removeList(favouriteItems.getRecords());
for (SearchFavourite sf : result) {
favouriteItems.add... | [
"private",
"void",
"initializeList",
"(",
")",
"{",
"FavouritesCommService",
".",
"getSearchFavourites",
"(",
"new",
"DataCallback",
"<",
"List",
"<",
"SearchFavourite",
">",
">",
"(",
")",
"{",
"public",
"void",
"execute",
"(",
"List",
"<",
"SearchFavourite",
... | get favourites from store | [
"get",
"favourites",
"from",
"store"
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/plugin/widget-searchandfilter/searchandfilter-gwt/src/main/java/org/geomajas/widget/searchandfilter/client/widget/searchfavourites/SearchFavouritesListPanel.java#L180-L189 |
147,262 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/spatial/geometry/MultiPoint.java | MultiPoint.getGeometryN | public Geometry getGeometryN(int n) {
if (isEmpty()) {
return null;
}
if (n >= 0 && n < points.length) {
return points[n];
}
throw new ArrayIndexOutOfBoundsException(n);
// return this;
} | java | public Geometry getGeometryN(int n) {
if (isEmpty()) {
return null;
}
if (n >= 0 && n < points.length) {
return points[n];
}
throw new ArrayIndexOutOfBoundsException(n);
// return this;
} | [
"public",
"Geometry",
"getGeometryN",
"(",
"int",
"n",
")",
"{",
"if",
"(",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"n",
">=",
"0",
"&&",
"n",
"<",
"points",
".",
"length",
")",
"{",
"return",
"points",
"[",
"n",
"... | Return null if the MultiPoint is empty, returns one of the points if the requested index exists, throws an
exception otherwise.
@param n
The index in the point array to retrieve. Better make sure it is a valid index. (0 < n < getNumPoints) | [
"Return",
"null",
"if",
"the",
"MultiPoint",
"is",
"empty",
"returns",
"one",
"of",
"the",
"points",
"if",
"the",
"requested",
"index",
"exists",
"throws",
"an",
"exception",
"otherwise",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/spatial/geometry/MultiPoint.java#L120-L129 |
147,263 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/spatial/geometry/MultiPoint.java | MultiPoint.getBounds | public Bbox getBounds() {
if (isEmpty()) {
return null;
}
double minX = Double.MAX_VALUE;
double minY = Double.MAX_VALUE;
double maxX = -Double.MAX_VALUE;
double maxY = -Double.MAX_VALUE;
for (Point point : points) {
if (point.getX() < minX) {
minX = point.getX();
}
if (point.getY() < min... | java | public Bbox getBounds() {
if (isEmpty()) {
return null;
}
double minX = Double.MAX_VALUE;
double minY = Double.MAX_VALUE;
double maxX = -Double.MAX_VALUE;
double maxY = -Double.MAX_VALUE;
for (Point point : points) {
if (point.getX() < minX) {
minX = point.getX();
}
if (point.getY() < min... | [
"public",
"Bbox",
"getBounds",
"(",
")",
"{",
"if",
"(",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"double",
"minX",
"=",
"Double",
".",
"MAX_VALUE",
";",
"double",
"minY",
"=",
"Double",
".",
"MAX_VALUE",
";",
"double",
"maxX",
"=",... | Return the bounding box spanning the full list of points. | [
"Return",
"the",
"bounding",
"box",
"spanning",
"the",
"full",
"list",
"of",
"points",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/spatial/geometry/MultiPoint.java#L147-L172 |
147,264 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/spatial/geometry/MultiPoint.java | MultiPoint.getCoordinates | public Coordinate[] getCoordinates() {
if (isEmpty()) {
return null;
}
Coordinate[] coordinates = new Coordinate[points.length];
for (int i = 0; i < points.length; i++) {
coordinates[i] = points[i].getCoordinate();
}
return coordinates;
} | java | public Coordinate[] getCoordinates() {
if (isEmpty()) {
return null;
}
Coordinate[] coordinates = new Coordinate[points.length];
for (int i = 0; i < points.length; i++) {
coordinates[i] = points[i].getCoordinate();
}
return coordinates;
} | [
"public",
"Coordinate",
"[",
"]",
"getCoordinates",
"(",
")",
"{",
"if",
"(",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"Coordinate",
"[",
"]",
"coordinates",
"=",
"new",
"Coordinate",
"[",
"points",
".",
"length",
"]",
";",
"for",
"... | Get the full list of coordinates from all the points in this MultiPoint geometry. If this geometry is empty, null
will be returned. | [
"Get",
"the",
"full",
"list",
"of",
"coordinates",
"from",
"all",
"the",
"points",
"in",
"this",
"MultiPoint",
"geometry",
".",
"If",
"this",
"geometry",
"is",
"empty",
"null",
"will",
"be",
"returned",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/spatial/geometry/MultiPoint.java#L188-L197 |
147,265 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/spatial/geometry/MultiPoint.java | MultiPoint.intersects | public boolean intersects(Geometry geometry) {
if (isEmpty()) {
return false;
}
for (Point point : points) {
if (point.intersects(geometry)) {
return true;
}
}
return false;
} | java | public boolean intersects(Geometry geometry) {
if (isEmpty()) {
return false;
}
for (Point point : points) {
if (point.intersects(geometry)) {
return true;
}
}
return false;
} | [
"public",
"boolean",
"intersects",
"(",
"Geometry",
"geometry",
")",
"{",
"if",
"(",
"isEmpty",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"for",
"(",
"Point",
"point",
":",
"points",
")",
"{",
"if",
"(",
"point",
".",
"intersects",
"(",
"geome... | Return true if any of the points intersect the given geometry. | [
"Return",
"true",
"if",
"any",
"of",
"the",
"points",
"intersect",
"the",
"given",
"geometry",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/spatial/geometry/MultiPoint.java#L206-L216 |
147,266 | geomajas/geomajas-project-client-gwt | plugin/widget-searchandfilter/searchandfilter-gwt/src/main/java/org/geomajas/widget/searchandfilter/client/widget/multifeaturelistgrid/MultiFeatureListGrid.java | MultiFeatureListGrid.addFeatures | public void addFeatures(Map<VectorLayer, List<Feature>> featureMap, Criterion criterion) {
if (showDetailsOnSingleResult && featureMap.size() == 1) {
// sorting is never needed if only 1 entry
List<Feature> features = featureMap.values().iterator().next();
if (features.size() == 1) {
showFeatureDetailWin... | java | public void addFeatures(Map<VectorLayer, List<Feature>> featureMap, Criterion criterion) {
if (showDetailsOnSingleResult && featureMap.size() == 1) {
// sorting is never needed if only 1 entry
List<Feature> features = featureMap.values().iterator().next();
if (features.size() == 1) {
showFeatureDetailWin... | [
"public",
"void",
"addFeatures",
"(",
"Map",
"<",
"VectorLayer",
",",
"List",
"<",
"Feature",
">",
">",
"featureMap",
",",
"Criterion",
"criterion",
")",
"{",
"if",
"(",
"showDetailsOnSingleResult",
"&&",
"featureMap",
".",
"size",
"(",
")",
"==",
"1",
")"... | Add features in the widget for several layers.
@param featureMap map of features per layer
@param criterion the original request for this search | [
"Add",
"features",
"in",
"the",
"widget",
"for",
"several",
"layers",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/plugin/widget-searchandfilter/searchandfilter-gwt/src/main/java/org/geomajas/widget/searchandfilter/client/widget/multifeaturelistgrid/MultiFeatureListGrid.java#L168-L184 |
147,267 | geomajas/geomajas-project-client-gwt | plugin/widget-searchandfilter/searchandfilter-gwt/src/main/java/org/geomajas/widget/searchandfilter/client/widget/multifeaturelistgrid/MultiFeatureListGrid.java | MultiFeatureListGrid.getSelection | @Api
public ListGridRecord[] getSelection(String layerId) {
String id = tabset.getID() + "_" + constructIdSaveLayerId(layerId);
FeatureListGridTab tab = (FeatureListGridTab) tabset.getTab(id);
if (tab != null) {
return tab.getSelection();
}
return null;
} | java | @Api
public ListGridRecord[] getSelection(String layerId) {
String id = tabset.getID() + "_" + constructIdSaveLayerId(layerId);
FeatureListGridTab tab = (FeatureListGridTab) tabset.getTab(id);
if (tab != null) {
return tab.getSelection();
}
return null;
} | [
"@",
"Api",
"public",
"ListGridRecord",
"[",
"]",
"getSelection",
"(",
"String",
"layerId",
")",
"{",
"String",
"id",
"=",
"tabset",
".",
"getID",
"(",
")",
"+",
"\"_\"",
"+",
"constructIdSaveLayerId",
"(",
"layerId",
")",
";",
"FeatureListGridTab",
"tab",
... | Get the selected records for the tab.
@param layerId layer to get selected items for
@return selected records | [
"Get",
"the",
"selected",
"records",
"for",
"the",
"tab",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/plugin/widget-searchandfilter/searchandfilter-gwt/src/main/java/org/geomajas/widget/searchandfilter/client/widget/multifeaturelistgrid/MultiFeatureListGrid.java#L272-L280 |
147,268 | wnameless/rubycollect4j | src/main/java/net/sf/rubycollect4j/RubyObject.java | RubyObject.isBlank | public static boolean isBlank(Object o) {
if (o instanceof CharSequence) {
CharSequence cs = (CharSequence) o;
return cs == null || new StringBuilder(cs.length()).append(cs).toString()
.trim().isEmpty();
}
if (o instanceof Iterable) {
Iterable<?> iter = (Iterable<?>) o;
ret... | java | public static boolean isBlank(Object o) {
if (o instanceof CharSequence) {
CharSequence cs = (CharSequence) o;
return cs == null || new StringBuilder(cs.length()).append(cs).toString()
.trim().isEmpty();
}
if (o instanceof Iterable) {
Iterable<?> iter = (Iterable<?>) o;
ret... | [
"public",
"static",
"boolean",
"isBlank",
"(",
"Object",
"o",
")",
"{",
"if",
"(",
"o",
"instanceof",
"CharSequence",
")",
"{",
"CharSequence",
"cs",
"=",
"(",
"CharSequence",
")",
"o",
";",
"return",
"cs",
"==",
"null",
"||",
"new",
"StringBuilder",
"("... | Checks if an Object is null, blank Iterable, blank Iterator, blank Map,
blank CharSequence or Boolean.FALSE.
@param o
any Object
@return true if given Object is blank, false otherwise | [
"Checks",
"if",
"an",
"Object",
"is",
"null",
"blank",
"Iterable",
"blank",
"Iterator",
"blank",
"Map",
"blank",
"CharSequence",
"or",
"Boolean",
".",
"FALSE",
"."
] | b8b8d8eccaca2254a3d09b91745882fb7a0d5add | https://github.com/wnameless/rubycollect4j/blob/b8b8d8eccaca2254a3d09b91745882fb7a0d5add/src/main/java/net/sf/rubycollect4j/RubyObject.java#L396-L420 |
147,269 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/widget/FeatureAttributeEditor.java | FeatureAttributeEditor.setFeature | public void setFeature(Feature feature) {
if (feature != null) {
this.feature = feature;
copyToForm(this.feature);
} else {
this.feature = null;
featureForm.clear();
}
} | java | public void setFeature(Feature feature) {
if (feature != null) {
this.feature = feature;
copyToForm(this.feature);
} else {
this.feature = null;
featureForm.clear();
}
} | [
"public",
"void",
"setFeature",
"(",
"Feature",
"feature",
")",
"{",
"if",
"(",
"feature",
"!=",
"null",
")",
"{",
"this",
".",
"feature",
"=",
"feature",
";",
"copyToForm",
"(",
"this",
".",
"feature",
")",
";",
"}",
"else",
"{",
"this",
".",
"featu... | Apply a new feature onto this widget. The feature will be immediately shown on the attribute form.
@param feature
feature | [
"Apply",
"a",
"new",
"feature",
"onto",
"this",
"widget",
".",
"The",
"feature",
"will",
"be",
"immediately",
"shown",
"on",
"the",
"attribute",
"form",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/widget/FeatureAttributeEditor.java#L158-L166 |
147,270 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/action/menu/RemovePointAction.java | RemovePointAction.onClick | public void onClick(MenuItemClickEvent event) {
FeatureTransaction ft = mapWidget.getMapModel().getFeatureEditor().getFeatureTransaction();
if (ft != null && index != null) {
mapWidget.render(ft, RenderGroup.VECTOR, RenderStatus.DELETE);
RemoveCoordinateOp op = new RemoveCoordinateOp(index);
ft.execute(op)... | java | public void onClick(MenuItemClickEvent event) {
FeatureTransaction ft = mapWidget.getMapModel().getFeatureEditor().getFeatureTransaction();
if (ft != null && index != null) {
mapWidget.render(ft, RenderGroup.VECTOR, RenderStatus.DELETE);
RemoveCoordinateOp op = new RemoveCoordinateOp(index);
ft.execute(op)... | [
"public",
"void",
"onClick",
"(",
"MenuItemClickEvent",
"event",
")",
"{",
"FeatureTransaction",
"ft",
"=",
"mapWidget",
".",
"getMapModel",
"(",
")",
".",
"getFeatureEditor",
"(",
")",
".",
"getFeatureTransaction",
"(",
")",
";",
"if",
"(",
"ft",
"!=",
"nul... | Remove an existing point from the geometry at a given index.
@param event
The {@link MenuItemClickEvent} from clicking the action. | [
"Remove",
"an",
"existing",
"point",
"from",
"the",
"geometry",
"at",
"a",
"given",
"index",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/action/menu/RemovePointAction.java#L59-L67 |
147,271 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/controller/PanController.java | PanController.onDoubleClick | public void onDoubleClick(DoubleClickEvent event) {
//Check if there was a last click that was handled in this class.
if (null != lastClickPosition) {
// Zoom in on the event location.
Bbox bounds = mapWidget.getMapModel().getMapView().getBounds();
double x = lastClickPosition.getX() - (bounds.getWidth() /... | java | public void onDoubleClick(DoubleClickEvent event) {
//Check if there was a last click that was handled in this class.
if (null != lastClickPosition) {
// Zoom in on the event location.
Bbox bounds = mapWidget.getMapModel().getMapView().getBounds();
double x = lastClickPosition.getX() - (bounds.getWidth() /... | [
"public",
"void",
"onDoubleClick",
"(",
"DoubleClickEvent",
"event",
")",
"{",
"//Check if there was a last click that was handled in this class.",
"if",
"(",
"null",
"!=",
"lastClickPosition",
")",
"{",
"// Zoom in on the event location.",
"Bbox",
"bounds",
"=",
"mapWidget",... | Zoom in to the double-clicked position. | [
"Zoom",
"in",
"to",
"the",
"double",
"-",
"clicked",
"position",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/controller/PanController.java#L124-L134 |
147,272 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/GwtCommandCallback.java | GwtCommandCallback.onCommunicationException | public void onCommunicationException(Throwable error) {
String msg = I18nProvider.getGlobal().commandCommunicationError() + ":\n" + error.getMessage();
Log.logWarn(msg, error);
SC.warn(msg);
} | java | public void onCommunicationException(Throwable error) {
String msg = I18nProvider.getGlobal().commandCommunicationError() + ":\n" + error.getMessage();
Log.logWarn(msg, error);
SC.warn(msg);
} | [
"public",
"void",
"onCommunicationException",
"(",
"Throwable",
"error",
")",
"{",
"String",
"msg",
"=",
"I18nProvider",
".",
"getGlobal",
"(",
")",
".",
"commandCommunicationError",
"(",
")",
"+",
"\":\\n\"",
"+",
"error",
".",
"getMessage",
"(",
")",
";",
... | Default behaviour for handling a communication exception. Shows a warning window to the user.
@param error error to report | [
"Default",
"behaviour",
"for",
"handling",
"a",
"communication",
"exception",
".",
"Shows",
"a",
"warning",
"window",
"to",
"the",
"user",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/GwtCommandCallback.java#L34-L38 |
147,273 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/GwtCommandCallback.java | GwtCommandCallback.onCommandException | public void onCommandException(CommandResponse response) {
String message = I18nProvider.getGlobal().commandError() + ":";
for (String error : response.getErrorMessages()) {
message += "\n" + error;
}
Log.logWarn(message);
if (response.getExceptions() == null || response.getExceptions().size() == 0) {
S... | java | public void onCommandException(CommandResponse response) {
String message = I18nProvider.getGlobal().commandError() + ":";
for (String error : response.getErrorMessages()) {
message += "\n" + error;
}
Log.logWarn(message);
if (response.getExceptions() == null || response.getExceptions().size() == 0) {
S... | [
"public",
"void",
"onCommandException",
"(",
"CommandResponse",
"response",
")",
"{",
"String",
"message",
"=",
"I18nProvider",
".",
"getGlobal",
"(",
")",
".",
"commandError",
"(",
")",
"+",
"\":\"",
";",
"for",
"(",
"String",
"error",
":",
"response",
".",... | Default behaviour for handling a command execution exception. Shows an exception report to the user.
@param response command response with error | [
"Default",
"behaviour",
"for",
"handling",
"a",
"command",
"execution",
"exception",
".",
"Shows",
"an",
"exception",
"report",
"to",
"the",
"user",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/GwtCommandCallback.java#L45-L58 |
147,274 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/widget/FeatureAttributeWindow.java | FeatureAttributeWindow.setFeature | public void setFeature(Feature feature) {
List<Feature> features = new ArrayList<Feature>();
features.add(feature);
LazyLoader.lazyLoad(features, GeomajasConstant.FEATURE_INCLUDE_ATTRIBUTES, new LazyLoadCallback() {
public void execute(List<Feature> response) {
Feature feature = response.get(0);
if (a... | java | public void setFeature(Feature feature) {
List<Feature> features = new ArrayList<Feature>();
features.add(feature);
LazyLoader.lazyLoad(features, GeomajasConstant.FEATURE_INCLUDE_ATTRIBUTES, new LazyLoadCallback() {
public void execute(List<Feature> response) {
Feature feature = response.get(0);
if (a... | [
"public",
"void",
"setFeature",
"(",
"Feature",
"feature",
")",
"{",
"List",
"<",
"Feature",
">",
"features",
"=",
"new",
"ArrayList",
"<",
"Feature",
">",
"(",
")",
";",
"features",
".",
"add",
"(",
"feature",
")",
";",
"LazyLoader",
".",
"lazyLoad",
... | Apply a new feature onto this widget, assuring the attributes are loaded.
@param feature feature | [
"Apply",
"a",
"new",
"feature",
"onto",
"this",
"widget",
"assuring",
"the",
"attributes",
"are",
"loaded",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/widget/FeatureAttributeWindow.java#L196-L214 |
147,275 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/widget/FeatureAttributeWindow.java | FeatureAttributeWindow.setEditingEnabled | public void setEditingEnabled(boolean editingEnabled) {
if (isEditingAllowed()) {
this.editingEnabled = editingEnabled;
if (editingEnabled) {
savePanel.setVisible(true);
if (attributeTable != null && attributeTable.isDisabled()) {
attributeTable.setDisabled(false);
}
} else {
savePanel.s... | java | public void setEditingEnabled(boolean editingEnabled) {
if (isEditingAllowed()) {
this.editingEnabled = editingEnabled;
if (editingEnabled) {
savePanel.setVisible(true);
if (attributeTable != null && attributeTable.isDisabled()) {
attributeTable.setDisabled(false);
}
} else {
savePanel.s... | [
"public",
"void",
"setEditingEnabled",
"(",
"boolean",
"editingEnabled",
")",
"{",
"if",
"(",
"isEditingAllowed",
"(",
")",
")",
"{",
"this",
".",
"editingEnabled",
"=",
"editingEnabled",
";",
"if",
"(",
"editingEnabled",
")",
"{",
"savePanel",
".",
"setVisibl... | Is editing currently enabled or not? This widget can toggle this value on the fly. When editing is enabled, it
will display an editable attribute form with save, cancel and reset buttons. When editing is not enabled, these
buttons will disappear, and a simple attribute form is shown that displays the attribute values, ... | [
"Is",
"editing",
"currently",
"enabled",
"or",
"not?",
"This",
"widget",
"can",
"toggle",
"this",
"value",
"on",
"the",
"fly",
".",
"When",
"editing",
"is",
"enabled",
"it",
"will",
"display",
"an",
"editable",
"attribute",
"form",
"with",
"save",
"cancel",
... | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/widget/FeatureAttributeWindow.java#L256-L271 |
147,276 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/util/GeometryConverter.java | GeometryConverter.toDto | public static Geometry toDto(org.geomajas.gwt.client.spatial.geometry.Geometry geometry) {
if (geometry == null) {
return null;
}
int srid = geometry.getSrid();
int precision = geometry.getPrecision();
Geometry dto;
if (geometry instanceof Point) {
dto = new Geometry(Geometry.POINT, srid, precision);... | java | public static Geometry toDto(org.geomajas.gwt.client.spatial.geometry.Geometry geometry) {
if (geometry == null) {
return null;
}
int srid = geometry.getSrid();
int precision = geometry.getPrecision();
Geometry dto;
if (geometry instanceof Point) {
dto = new Geometry(Geometry.POINT, srid, precision);... | [
"public",
"static",
"Geometry",
"toDto",
"(",
"org",
".",
"geomajas",
".",
"gwt",
".",
"client",
".",
"spatial",
".",
"geometry",
".",
"Geometry",
"geometry",
")",
"{",
"if",
"(",
"geometry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"int",
... | Takes in a GWT geometry, and creates a new DTO geometry from it.
@param geometry
The geometry to convert into a DTO geometry.
@return Returns a DTO type geometry, that is serializable. | [
"Takes",
"in",
"a",
"GWT",
"geometry",
"and",
"creates",
"a",
"new",
"DTO",
"geometry",
"from",
"it",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/util/GeometryConverter.java#L47-L94 |
147,277 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/util/GeometryConverter.java | GeometryConverter.toDto | public static Bbox toDto(org.geomajas.gwt.client.spatial.Bbox bbox) {
return new Bbox(bbox.getX(), bbox.getY(), bbox.getWidth(), bbox.getHeight());
} | java | public static Bbox toDto(org.geomajas.gwt.client.spatial.Bbox bbox) {
return new Bbox(bbox.getX(), bbox.getY(), bbox.getWidth(), bbox.getHeight());
} | [
"public",
"static",
"Bbox",
"toDto",
"(",
"org",
".",
"geomajas",
".",
"gwt",
".",
"client",
".",
"spatial",
".",
"Bbox",
"bbox",
")",
"{",
"return",
"new",
"Bbox",
"(",
"bbox",
".",
"getX",
"(",
")",
",",
"bbox",
".",
"getY",
"(",
")",
",",
"bbo... | Takes in a GWT bbox, and creates a new DTO bbox from it.
@param bbox
The bbox to convert into a DTO bbox.
@return Returns a DTO type bbox, that is serializable. | [
"Takes",
"in",
"a",
"GWT",
"bbox",
"and",
"creates",
"a",
"new",
"DTO",
"bbox",
"from",
"it",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/util/GeometryConverter.java#L169-L171 |
147,278 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/util/GeometryConverter.java | GeometryConverter.toGwt | public static org.geomajas.gwt.client.spatial.Bbox toGwt(Bbox bbox) {
return new org.geomajas.gwt.client.spatial.Bbox(bbox);
} | java | public static org.geomajas.gwt.client.spatial.Bbox toGwt(Bbox bbox) {
return new org.geomajas.gwt.client.spatial.Bbox(bbox);
} | [
"public",
"static",
"org",
".",
"geomajas",
".",
"gwt",
".",
"client",
".",
"spatial",
".",
"Bbox",
"toGwt",
"(",
"Bbox",
"bbox",
")",
"{",
"return",
"new",
"org",
".",
"geomajas",
".",
"gwt",
".",
"client",
".",
"spatial",
".",
"Bbox",
"(",
"bbox",
... | Takes in a DTO bbox, and creates a new GWT bbox from it.
@param bbox
The bbox to convert into a GWT bbox.
@return Returns a GWT type bbox, that has functionality. | [
"Takes",
"in",
"a",
"DTO",
"bbox",
"and",
"creates",
"a",
"new",
"GWT",
"bbox",
"from",
"it",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/util/GeometryConverter.java#L180-L182 |
147,279 | telegram-s/telegram-mt | src/main/java/org/telegram/mtproto/MTProto.java | MTProto.sendRpcMessage | public int sendRpcMessage(TLMethod request, long timeout, boolean highPriority) {
int id = scheduller.postMessage(request, true, timeout, highPriority);
Logger.d(TAG, "sendMessage #" + id + " " + request.toString() + " with timeout " + timeout + " ms");
return id;
} | java | public int sendRpcMessage(TLMethod request, long timeout, boolean highPriority) {
int id = scheduller.postMessage(request, true, timeout, highPriority);
Logger.d(TAG, "sendMessage #" + id + " " + request.toString() + " with timeout " + timeout + " ms");
return id;
} | [
"public",
"int",
"sendRpcMessage",
"(",
"TLMethod",
"request",
",",
"long",
"timeout",
",",
"boolean",
"highPriority",
")",
"{",
"int",
"id",
"=",
"scheduller",
".",
"postMessage",
"(",
"request",
",",
"true",
",",
"timeout",
",",
"highPriority",
")",
";",
... | Sending rpc request
@param request request
@param timeout timeout of request
@param highPriority is hight priority request
@return request id | [
"Sending",
"rpc",
"request"
] | 57e3f635a6508705081eba9396ae24db050bc943 | https://github.com/telegram-s/telegram-mt/blob/57e3f635a6508705081eba9396ae24db050bc943/src/main/java/org/telegram/mtproto/MTProto.java#L264-L268 |
147,280 | telegram-s/telegram-mt | src/main/java/org/telegram/mtproto/MTProto.java | MTProto.switchMode | public void switchMode(int mode) {
if (this.mode != mode) {
this.mode = mode;
switch (mode) {
case MODE_GENERAL:
case MODE_PUSH:
transportPool.switchMode(TransportPool.MODE_DEFAULT);
break;
case MODE... | java | public void switchMode(int mode) {
if (this.mode != mode) {
this.mode = mode;
switch (mode) {
case MODE_GENERAL:
case MODE_PUSH:
transportPool.switchMode(TransportPool.MODE_DEFAULT);
break;
case MODE... | [
"public",
"void",
"switchMode",
"(",
"int",
"mode",
")",
"{",
"if",
"(",
"this",
".",
"mode",
"!=",
"mode",
")",
"{",
"this",
".",
"mode",
"=",
"mode",
";",
"switch",
"(",
"mode",
")",
"{",
"case",
"MODE_GENERAL",
":",
"case",
"MODE_PUSH",
":",
"tr... | Switch mode of mtproto
@param mode new mode | [
"Switch",
"mode",
"of",
"mtproto"
] | 57e3f635a6508705081eba9396ae24db050bc943 | https://github.com/telegram-s/telegram-mt/blob/57e3f635a6508705081eba9396ae24db050bc943/src/main/java/org/telegram/mtproto/MTProto.java#L284-L302 |
147,281 | telegram-s/telegram-mt | src/main/java/org/telegram/mtproto/MTProto.java | MTProto.onMTMessage | private void onMTMessage(MTMessage mtMessage) {
if (mtMessage.getSeqNo() % 2 == 1) {
scheduller.confirmMessage(mtMessage.getMessageId());
}
if (!needProcessing(mtMessage.getMessageId())) {
if (Logger.LOG_IGNORED) {
Logger.d(TAG, "Ignoring messages #" + mtM... | java | private void onMTMessage(MTMessage mtMessage) {
if (mtMessage.getSeqNo() % 2 == 1) {
scheduller.confirmMessage(mtMessage.getMessageId());
}
if (!needProcessing(mtMessage.getMessageId())) {
if (Logger.LOG_IGNORED) {
Logger.d(TAG, "Ignoring messages #" + mtM... | [
"private",
"void",
"onMTMessage",
"(",
"MTMessage",
"mtMessage",
")",
"{",
"if",
"(",
"mtMessage",
".",
"getSeqNo",
"(",
")",
"%",
"2",
"==",
"1",
")",
"{",
"scheduller",
".",
"confirmMessage",
"(",
"mtMessage",
".",
"getMessageId",
"(",
")",
")",
";",
... | Finding message type | [
"Finding",
"message",
"type"
] | 57e3f635a6508705081eba9396ae24db050bc943 | https://github.com/telegram-s/telegram-mt/blob/57e3f635a6508705081eba9396ae24db050bc943/src/main/java/org/telegram/mtproto/MTProto.java#L330-L349 |
147,282 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/store/ClientWmsRasterLayerStore.java | ClientWmsRasterLayerStore.calculateTilesForBounds | private List<org.geomajas.layer.tile.RasterTile> calculateTilesForBounds(Bbox bounds) {
List<org.geomajas.layer.tile.RasterTile> tiles = new ArrayList<org.geomajas.layer.tile.RasterTile>();
if (bounds.getHeight() == 0 || bounds.getWidth() == 0) {
return tiles;
}
return tiles;
} | java | private List<org.geomajas.layer.tile.RasterTile> calculateTilesForBounds(Bbox bounds) {
List<org.geomajas.layer.tile.RasterTile> tiles = new ArrayList<org.geomajas.layer.tile.RasterTile>();
if (bounds.getHeight() == 0 || bounds.getWidth() == 0) {
return tiles;
}
return tiles;
} | [
"private",
"List",
"<",
"org",
".",
"geomajas",
".",
"layer",
".",
"tile",
".",
"RasterTile",
">",
"calculateTilesForBounds",
"(",
"Bbox",
"bounds",
")",
"{",
"List",
"<",
"org",
".",
"geomajas",
".",
"layer",
".",
"tile",
".",
"RasterTile",
">",
"tiles"... | Method based on WmsTileServiceImpl in GWT2 client. | [
"Method",
"based",
"on",
"WmsTileServiceImpl",
"in",
"GWT2",
"client",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/store/ClientWmsRasterLayerStore.java#L109-L118 |
147,283 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/widget/Toolbar.java | Toolbar.initialize | public void initialize(ClientMapInfo mapInfo) {
// remove previous members
super.removeMembers(getMembers());
// add new members
ClientToolbarInfo toolbarInfo = mapInfo.getToolbar();
if (toolbarInfo != null) {
for (ClientToolInfo tool : toolbarInfo.getTools()) {
String id = tool.getToolId();
if (T... | java | public void initialize(ClientMapInfo mapInfo) {
// remove previous members
super.removeMembers(getMembers());
// add new members
ClientToolbarInfo toolbarInfo = mapInfo.getToolbar();
if (toolbarInfo != null) {
for (ClientToolInfo tool : toolbarInfo.getTools()) {
String id = tool.getToolId();
if (T... | [
"public",
"void",
"initialize",
"(",
"ClientMapInfo",
"mapInfo",
")",
"{",
"// remove previous members",
"super",
".",
"removeMembers",
"(",
"getMembers",
"(",
")",
")",
";",
"// add new members",
"ClientToolbarInfo",
"toolbarInfo",
"=",
"mapInfo",
".",
"getToolbar",
... | Initialize this widget.
@param mapInfo map info | [
"Initialize",
"this",
"widget",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/widget/Toolbar.java#L143-L187 |
147,284 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/widget/Toolbar.java | Toolbar.addActionButton | public void addActionButton(final ToolbarAction action) {
final IButton button = new IButton();
button.setWidth(buttonSize);
button.setHeight(buttonSize);
button.setIconSize(buttonSize - WidgetLayout.toolbarStripHeight);
button.setIcon(action.getIcon());
button.setActionType(SelectionType.BUTTON);
button.... | java | public void addActionButton(final ToolbarAction action) {
final IButton button = new IButton();
button.setWidth(buttonSize);
button.setHeight(buttonSize);
button.setIconSize(buttonSize - WidgetLayout.toolbarStripHeight);
button.setIcon(action.getIcon());
button.setActionType(SelectionType.BUTTON);
button.... | [
"public",
"void",
"addActionButton",
"(",
"final",
"ToolbarAction",
"action",
")",
"{",
"final",
"IButton",
"button",
"=",
"new",
"IButton",
"(",
")",
";",
"button",
".",
"setWidth",
"(",
"buttonSize",
")",
";",
"button",
".",
"setHeight",
"(",
"buttonSize",... | Add a new action button to the toolbar. An action button is the kind of button that executes immediately when
clicked upon. It can not be selected or deselected, it just executes every click.
@param action
The actual action to execute on click. | [
"Add",
"a",
"new",
"action",
"button",
"to",
"the",
"toolbar",
".",
"An",
"action",
"button",
"is",
"the",
"kind",
"of",
"button",
"that",
"executes",
"immediately",
"when",
"clicked",
"upon",
".",
"It",
"can",
"not",
"be",
"selected",
"or",
"deselected",
... | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/widget/Toolbar.java#L196-L225 |
147,285 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/widget/Toolbar.java | Toolbar.addToolbarSeparator | public void addToolbarSeparator() {
ToolStripSeparator stripSeparator = new ToolStripSeparator();
stripSeparator.setHeight(WidgetLayout.toolbarStripHeight);
super.addMember(stripSeparator);
} | java | public void addToolbarSeparator() {
ToolStripSeparator stripSeparator = new ToolStripSeparator();
stripSeparator.setHeight(WidgetLayout.toolbarStripHeight);
super.addMember(stripSeparator);
} | [
"public",
"void",
"addToolbarSeparator",
"(",
")",
"{",
"ToolStripSeparator",
"stripSeparator",
"=",
"new",
"ToolStripSeparator",
"(",
")",
";",
"stripSeparator",
".",
"setHeight",
"(",
"WidgetLayout",
".",
"toolbarStripHeight",
")",
";",
"super",
".",
"addMember",
... | Add a vertical line to the toolbar. | [
"Add",
"a",
"vertical",
"line",
"to",
"the",
"toolbar",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/widget/Toolbar.java#L282-L286 |
147,286 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/spatial/snapping/SnappingMode.java | SnappingMode.setCoordinate | public void setCoordinate(Coordinate coordinate) {
if (coordinate == null) {
throw new IllegalArgumentException("Can't snap to a null coordinate.");
}
this.coordinate = coordinate;
bounds = new Bbox(coordinate.getX() - rule.getDistance(), coordinate.getY() - rule.getDistance(), rule
.getDistance() * 2, r... | java | public void setCoordinate(Coordinate coordinate) {
if (coordinate == null) {
throw new IllegalArgumentException("Can't snap to a null coordinate.");
}
this.coordinate = coordinate;
bounds = new Bbox(coordinate.getX() - rule.getDistance(), coordinate.getY() - rule.getDistance(), rule
.getDistance() * 2, r... | [
"public",
"void",
"setCoordinate",
"(",
"Coordinate",
"coordinate",
")",
"{",
"if",
"(",
"coordinate",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Can't snap to a null coordinate.\"",
")",
";",
"}",
"this",
".",
"coordinate",
"=",
... | Set a new coordinate ready to be snapped. | [
"Set",
"a",
"new",
"coordinate",
"ready",
"to",
"be",
"snapped",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/spatial/snapping/SnappingMode.java#L79-L88 |
147,287 | wnameless/rubycollect4j | src/main/java/net/sf/rubycollect4j/util/RegexUtils.java | RegexUtils.convertGlobToRegex | public static String convertGlobToRegex(String pattern) {
pattern = pattern.replaceAll("[\\\\\\.\\(\\)\\+\\|\\^\\$]", "\\\\$0");
pattern = pattern.replaceAll("\\[\\\\\\^", "[^");
pattern = Ruby.String.of(pattern).gsub("\\{[^\\}]+\\}", m -> {
m = m.replaceAll(",", "|");
m = "(" + m.substring(1, ... | java | public static String convertGlobToRegex(String pattern) {
pattern = pattern.replaceAll("[\\\\\\.\\(\\)\\+\\|\\^\\$]", "\\\\$0");
pattern = pattern.replaceAll("\\[\\\\\\^", "[^");
pattern = Ruby.String.of(pattern).gsub("\\{[^\\}]+\\}", m -> {
m = m.replaceAll(",", "|");
m = "(" + m.substring(1, ... | [
"public",
"static",
"String",
"convertGlobToRegex",
"(",
"String",
"pattern",
")",
"{",
"pattern",
"=",
"pattern",
".",
"replaceAll",
"(",
"\"[\\\\\\\\\\\\.\\\\(\\\\)\\\\+\\\\|\\\\^\\\\$]\"",
",",
"\"\\\\\\\\$0\"",
")",
";",
"pattern",
"=",
"pattern",
".",
"replaceAll... | Converts a glob pattern to Regex string.
@param pattern
a glob pattern
@return a Regex string | [
"Converts",
"a",
"glob",
"pattern",
"to",
"Regex",
"string",
"."
] | b8b8d8eccaca2254a3d09b91745882fb7a0d5add | https://github.com/wnameless/rubycollect4j/blob/b8b8d8eccaca2254a3d09b91745882fb7a0d5add/src/main/java/net/sf/rubycollect4j/util/RegexUtils.java#L40-L53 |
147,288 | lukin0110/poeditor-java | src/main/java/be/lukin/poeditor/POEditorClient.java | POEditorClient.addAdministrator | public boolean addAdministrator(String projectId, String name, String email){
ResponseWrapper wrapper = service.addProjectMember(Action.ADD_CONTRIBUTOR, apiKey, projectId, name, email, null, 1);
return "200".equals(wrapper.response.code);
} | java | public boolean addAdministrator(String projectId, String name, String email){
ResponseWrapper wrapper = service.addProjectMember(Action.ADD_CONTRIBUTOR, apiKey, projectId, name, email, null, 1);
return "200".equals(wrapper.response.code);
} | [
"public",
"boolean",
"addAdministrator",
"(",
"String",
"projectId",
",",
"String",
"name",
",",
"String",
"email",
")",
"{",
"ResponseWrapper",
"wrapper",
"=",
"service",
".",
"addProjectMember",
"(",
"Action",
".",
"ADD_CONTRIBUTOR",
",",
"apiKey",
",",
"proje... | Create a new admin for a project
@param projectId id of the project
@param name name of the admin
@param email email of the admin
@return boolean if the administrator has been created | [
"Create",
"a",
"new",
"admin",
"for",
"a",
"project"
] | 42a2cd3136da1276b29a57a483c94050cc7d1d01 | https://github.com/lukin0110/poeditor-java/blob/42a2cd3136da1276b29a57a483c94050cc7d1d01/src/main/java/be/lukin/poeditor/POEditorClient.java#L183-L186 |
147,289 | lukin0110/poeditor-java | src/main/java/be/lukin/poeditor/POEditorClient.java | POEditorClient.addTerms | public TermsDetails addTerms(String projectId, List<Term> terms){
String jsonTerms = new Gson().toJson(terms);
EditTermsResponse atr = service.editTerms(Action.ADD_TERMS, apiKey, projectId, jsonTerms);
ApiUtils.checkResponse(atr.response);
return atr.details;
} | java | public TermsDetails addTerms(String projectId, List<Term> terms){
String jsonTerms = new Gson().toJson(terms);
EditTermsResponse atr = service.editTerms(Action.ADD_TERMS, apiKey, projectId, jsonTerms);
ApiUtils.checkResponse(atr.response);
return atr.details;
} | [
"public",
"TermsDetails",
"addTerms",
"(",
"String",
"projectId",
",",
"List",
"<",
"Term",
">",
"terms",
")",
"{",
"String",
"jsonTerms",
"=",
"new",
"Gson",
"(",
")",
".",
"toJson",
"(",
"terms",
")",
";",
"EditTermsResponse",
"atr",
"=",
"service",
".... | Add new terms to a project
@param projectId id of the project
@param terms list of terms
@return details about the operation | [
"Add",
"new",
"terms",
"to",
"a",
"project"
] | 42a2cd3136da1276b29a57a483c94050cc7d1d01 | https://github.com/lukin0110/poeditor-java/blob/42a2cd3136da1276b29a57a483c94050cc7d1d01/src/main/java/be/lukin/poeditor/POEditorClient.java#L210-L215 |
147,290 | lukin0110/poeditor-java | src/main/java/be/lukin/poeditor/POEditorClient.java | POEditorClient.export | public File export(String projectId, String language, FileTypeEnum fte, FilterByEnum[] filters){
return export(projectId, language, fte, filters, null, null);
} | java | public File export(String projectId, String language, FileTypeEnum fte, FilterByEnum[] filters){
return export(projectId, language, fte, filters, null, null);
} | [
"public",
"File",
"export",
"(",
"String",
"projectId",
",",
"String",
"language",
",",
"FileTypeEnum",
"fte",
",",
"FilterByEnum",
"[",
"]",
"filters",
")",
"{",
"return",
"export",
"(",
"projectId",
",",
"language",
",",
"fte",
",",
"filters",
",",
"null... | Export a translation for a language of a project.
@param projectId id of the project
@param language language code
@param fte which type to export
@param filters which filter to apply
@return file object of the exported file | [
"Export",
"a",
"translation",
"for",
"a",
"language",
"of",
"a",
"project",
"."
] | 42a2cd3136da1276b29a57a483c94050cc7d1d01 | https://github.com/lukin0110/poeditor-java/blob/42a2cd3136da1276b29a57a483c94050cc7d1d01/src/main/java/be/lukin/poeditor/POEditorClient.java#L233-L235 |
147,291 | lukin0110/poeditor-java | src/main/java/be/lukin/poeditor/POEditorClient.java | POEditorClient.uploadTerms | public UploadDetails uploadTerms(String projectId, File translationFile, String[] allTags, String[] newTags, String[] obsoleteTags){
Map<String, String[]> tags = new HashMap<String, String[]>();
if(allTags != null) {
tags.put("all", allTags);
}
if(newTags != null) {
... | java | public UploadDetails uploadTerms(String projectId, File translationFile, String[] allTags, String[] newTags, String[] obsoleteTags){
Map<String, String[]> tags = new HashMap<String, String[]>();
if(allTags != null) {
tags.put("all", allTags);
}
if(newTags != null) {
... | [
"public",
"UploadDetails",
"uploadTerms",
"(",
"String",
"projectId",
",",
"File",
"translationFile",
",",
"String",
"[",
"]",
"allTags",
",",
"String",
"[",
"]",
"newTags",
",",
"String",
"[",
"]",
"obsoleteTags",
")",
"{",
"Map",
"<",
"String",
",",
"Str... | Uploads a translation file. For the moment it only takes terms into account.
@param projectId id of the project
@param translationFile terms file to upload
@param allTags - for the all the imported terms
@param newTags - for the terms which aren't already in the project
@param obsoleteTags - for the terms which are in... | [
"Uploads",
"a",
"translation",
"file",
".",
"For",
"the",
"moment",
"it",
"only",
"takes",
"terms",
"into",
"account",
"."
] | 42a2cd3136da1276b29a57a483c94050cc7d1d01 | https://github.com/lukin0110/poeditor-java/blob/42a2cd3136da1276b29a57a483c94050cc7d1d01/src/main/java/be/lukin/poeditor/POEditorClient.java#L287-L307 |
147,292 | geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/context/SvgPathDecoder.java | SvgPathDecoder.decodeLineString | private static String decodeLineString(LineString lineString) {
if (lineString == null || lineString.isEmpty()) {
return "";
}
StringBuilder buffer = new StringBuilder();
Coordinate[] coordinates = lineString.getCoordinates();
for (int i = 0; i < coordinates.length; i++) {
buffer.append(getX(coordinates... | java | private static String decodeLineString(LineString lineString) {
if (lineString == null || lineString.isEmpty()) {
return "";
}
StringBuilder buffer = new StringBuilder();
Coordinate[] coordinates = lineString.getCoordinates();
for (int i = 0; i < coordinates.length; i++) {
buffer.append(getX(coordinates... | [
"private",
"static",
"String",
"decodeLineString",
"(",
"LineString",
"lineString",
")",
"{",
"if",
"(",
"lineString",
"==",
"null",
"||",
"lineString",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"StringBuilder",
"buffer",
"=",
"new",
... | Decode LineString.
@param lineString
@return | [
"Decode",
"LineString",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/SvgPathDecoder.java#L83-L98 |
147,293 | geomajas/geomajas-project-client-gwt | plugin/editing/editing-javascript-api/src/main/java/org/geomajas/plugin/editing/jsapi/client/service/JsGeometryIndexStateService.java | JsGeometryIndexStateService.getSelection | GeometryIndex[] getSelection() {
List<GeometryIndex> indices = delegate.getSelection();
return indices.toArray(new GeometryIndex[indices.size()]);
} | java | GeometryIndex[] getSelection() {
List<GeometryIndex> indices = delegate.getSelection();
return indices.toArray(new GeometryIndex[indices.size()]);
} | [
"GeometryIndex",
"[",
"]",
"getSelection",
"(",
")",
"{",
"List",
"<",
"GeometryIndex",
">",
"indices",
"=",
"delegate",
".",
"getSelection",
"(",
")",
";",
"return",
"indices",
".",
"toArray",
"(",
"new",
"GeometryIndex",
"[",
"indices",
".",
"size",
"(",... | Get the current selection. Do not make changes on this list!
@return The current selection (vertices/edges/sub-geometries). | [
"Get",
"the",
"current",
"selection",
".",
"Do",
"not",
"make",
"changes",
"on",
"this",
"list!"
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/plugin/editing/editing-javascript-api/src/main/java/org/geomajas/plugin/editing/jsapi/client/service/JsGeometryIndexStateService.java#L177-L180 |
147,294 | seedstack/i18n-addon | rest/src/main/java/org/seedstack/i18n/rest/internal/shared/BooleanUtils.java | BooleanUtils.falseToNull | @SuppressFBWarnings(value = "NP_BOOLEAN_RETURN_NULL", justification = "That's the point (but dubious)")
public static Boolean falseToNull(Boolean bool) {
if (bool != null && bool) {
return true;
}
return null;
} | java | @SuppressFBWarnings(value = "NP_BOOLEAN_RETURN_NULL", justification = "That's the point (but dubious)")
public static Boolean falseToNull(Boolean bool) {
if (bool != null && bool) {
return true;
}
return null;
} | [
"@",
"SuppressFBWarnings",
"(",
"value",
"=",
"\"NP_BOOLEAN_RETURN_NULL\"",
",",
"justification",
"=",
"\"That's the point (but dubious)\"",
")",
"public",
"static",
"Boolean",
"falseToNull",
"(",
"Boolean",
"bool",
")",
"{",
"if",
"(",
"bool",
"!=",
"null",
"&&",
... | If bool is false change it to null, otherwise do nothing.
@param bool boolean
@return true if bool is true, null otherwise | [
"If",
"bool",
"is",
"false",
"change",
"it",
"to",
"null",
"otherwise",
"do",
"nothing",
"."
] | 1e65101d8554623f09bda2497b0151fd10a16615 | https://github.com/seedstack/i18n-addon/blob/1e65101d8554623f09bda2497b0151fd10a16615/rest/src/main/java/org/seedstack/i18n/rest/internal/shared/BooleanUtils.java#L30-L36 |
147,295 | geomajas/geomajas-project-client-gwt | plugin/widget-featureinfo/featureinfo-gwt/src/main/java/org/geomajas/widget/featureinfo/client/widget/DockableWindow.java | DockableWindow.mixin | public static void mixin(Window window) {
final Docker docker = new Docker(window);
window.addMinimizeClickHandler(docker);
window.addRestoreClickHandler(docker);
} | java | public static void mixin(Window window) {
final Docker docker = new Docker(window);
window.addMinimizeClickHandler(docker);
window.addRestoreClickHandler(docker);
} | [
"public",
"static",
"void",
"mixin",
"(",
"Window",
"window",
")",
"{",
"final",
"Docker",
"docker",
"=",
"new",
"Docker",
"(",
"window",
")",
";",
"window",
".",
"addMinimizeClickHandler",
"(",
"docker",
")",
";",
"window",
".",
"addRestoreClickHandler",
"(... | Add the functionality to an existing window.
@param window
the window to which you want to add docking functionality. | [
"Add",
"the",
"functionality",
"to",
"an",
"existing",
"window",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/plugin/widget-featureinfo/featureinfo-gwt/src/main/java/org/geomajas/widget/featureinfo/client/widget/DockableWindow.java#L79-L83 |
147,296 | geomajas/geomajas-project-client-gwt | plugin/widget-featureinfo/featureinfo-gwt/src/main/java/org/geomajas/widget/featureinfo/client/widget/DockableWindow.java | DockableWindow.createDefaultDock | public static HLayout createDefaultDock() {
HLayout windowDock = new HLayout(5);
windowDock.setHeight(22);
windowDock.setAutoWidth();
windowDock.setSnapTo("BL");
windowDock.setSnapOffsetTop(-0);
windowDock.setSnapOffsetLeft(0);
windowDock.setBorder("thin dashed red");
return windowDock;
} | java | public static HLayout createDefaultDock() {
HLayout windowDock = new HLayout(5);
windowDock.setHeight(22);
windowDock.setAutoWidth();
windowDock.setSnapTo("BL");
windowDock.setSnapOffsetTop(-0);
windowDock.setSnapOffsetLeft(0);
windowDock.setBorder("thin dashed red");
return windowDock;
} | [
"public",
"static",
"HLayout",
"createDefaultDock",
"(",
")",
"{",
"HLayout",
"windowDock",
"=",
"new",
"HLayout",
"(",
"5",
")",
";",
"windowDock",
".",
"setHeight",
"(",
"22",
")",
";",
"windowDock",
".",
"setAutoWidth",
"(",
")",
";",
"windowDock",
".",... | This will create a windowDock based on a HLayout and placed in the
dockParent if provided.
@return a WindowDock | [
"This",
"will",
"create",
"a",
"windowDock",
"based",
"on",
"a",
"HLayout",
"and",
"placed",
"in",
"the",
"dockParent",
"if",
"provided",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/plugin/widget-featureinfo/featureinfo-gwt/src/main/java/org/geomajas/widget/featureinfo/client/widget/DockableWindow.java#L91-L100 |
147,297 | seedstack/i18n-addon | rest/src/main/java/org/seedstack/i18n/rest/internal/io/IOResource.java | IOResource.importTranslations | @POST
@Consumes("multipart/form-data")
@RequiresPermissions(I18nPermissions.KEY_WRITE)
public Response importTranslations(FormDataMultiPart multiPart) {
WebAssertions.assertNotNull(multiPart, "Missing input file");
int importedKeys = 0;
for (BodyPart bodyPart : multiPart.getBodyPart... | java | @POST
@Consumes("multipart/form-data")
@RequiresPermissions(I18nPermissions.KEY_WRITE)
public Response importTranslations(FormDataMultiPart multiPart) {
WebAssertions.assertNotNull(multiPart, "Missing input file");
int importedKeys = 0;
for (BodyPart bodyPart : multiPart.getBodyPart... | [
"@",
"POST",
"@",
"Consumes",
"(",
"\"multipart/form-data\"",
")",
"@",
"RequiresPermissions",
"(",
"I18nPermissions",
".",
"KEY_WRITE",
")",
"public",
"Response",
"importTranslations",
"(",
"FormDataMultiPart",
"multiPart",
")",
"{",
"WebAssertions",
".",
"assertNotN... | Imports one or more CSV files containing i18n keys with their translations.
@param multiPart multipart data
@return status code 200, or 400 if the multipart is null | [
"Imports",
"one",
"or",
"more",
"CSV",
"files",
"containing",
"i18n",
"keys",
"with",
"their",
"translations",
"."
] | 1e65101d8554623f09bda2497b0151fd10a16615 | https://github.com/seedstack/i18n-addon/blob/1e65101d8554623f09bda2497b0151fd10a16615/rest/src/main/java/org/seedstack/i18n/rest/internal/io/IOResource.java#L76-L90 |
147,298 | seedstack/i18n-addon | rest/src/main/java/org/seedstack/i18n/rest/internal/io/IOResource.java | IOResource.exportTranslations | @GET
@Produces(MediaType.TEXT_PLAIN)
@RequiresPermissions(I18nPermissions.KEY_READ)
public Response exportTranslations() {
final List<Key> keys = keyRepository.loadAll();
return Response.ok(new StreamingOutput() {
private boolean isFirstLine = true;
@Override
... | java | @GET
@Produces(MediaType.TEXT_PLAIN)
@RequiresPermissions(I18nPermissions.KEY_READ)
public Response exportTranslations() {
final List<Key> keys = keyRepository.loadAll();
return Response.ok(new StreamingOutput() {
private boolean isFirstLine = true;
@Override
... | [
"@",
"GET",
"@",
"Produces",
"(",
"MediaType",
".",
"TEXT_PLAIN",
")",
"@",
"RequiresPermissions",
"(",
"I18nPermissions",
".",
"KEY_READ",
")",
"public",
"Response",
"exportTranslations",
"(",
")",
"{",
"final",
"List",
"<",
"Key",
">",
"keys",
"=",
"keyRep... | Streams a CSV file with all keys with their translations.
@return an i18n.csv file | [
"Streams",
"a",
"CSV",
"file",
"with",
"all",
"keys",
"with",
"their",
"translations",
"."
] | 1e65101d8554623f09bda2497b0151fd10a16615 | https://github.com/seedstack/i18n-addon/blob/1e65101d8554623f09bda2497b0151fd10a16615/rest/src/main/java/org/seedstack/i18n/rest/internal/io/IOResource.java#L111-L133 |
147,299 | lukin0110/poeditor-java | src/main/java/be/lukin/poeditor/JarMain.java | JarMain.main | public static void main(String[] args) throws IOException {
if(args.length == 0){
System.out.println("No command given, choose: \n\tinit\n\tpull\n\tpush\n\tpushTerms");
return;
}
Map<String, String> parameters = new HashMap<String, String>();
if(args.leng... | java | public static void main(String[] args) throws IOException {
if(args.length == 0){
System.out.println("No command given, choose: \n\tinit\n\tpull\n\tpush\n\tpushTerms");
return;
}
Map<String, String> parameters = new HashMap<String, String>();
if(args.leng... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"IOException",
"{",
"if",
"(",
"args",
".",
"length",
"==",
"0",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"No command given, choose: \\n\\tinit\\n\\tpull\\n\\tpus... | By default read config from current dir
@param args cmd
@throws java.io.IOException when the configuration file can't be found | [
"By",
"default",
"read",
"config",
"from",
"current",
"dir"
] | 42a2cd3136da1276b29a57a483c94050cc7d1d01 | https://github.com/lukin0110/poeditor-java/blob/42a2cd3136da1276b29a57a483c94050cc7d1d01/src/main/java/be/lukin/poeditor/JarMain.java#L20-L71 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.