Skip to content

New sample: Edit features with feature-linked annotation #543

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 190 commits into from
Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
190 commits
Select commit Hold shift + click to select a range
8473b0c
update api version
tschie Oct 19, 2018
51f7c30
change api version to 100.5.0
tschie Oct 19, 2018
6349008
Merge branch 'master' into dev
tschie Oct 19, 2018
b791ff8
Merge branch 'dev' into 100.5.0
tschie Oct 19, 2018
6d1ba27
change version to 100.5.0
tschie Oct 19, 2018
1f322ee
Merge branch 'master' into dev
tschie Oct 22, 2018
a240829
Merge branch 'master' into 100.5.0
tschie Oct 22, 2018
3d6ab90
Merge branch 'master' into 100.5.0
tschie Oct 23, 2018
26a21ab
Merge branch '100.5.0' into dev
tschie Oct 23, 2018
e05b73e
Merge branch 'master' into dev
tschie Oct 23, 2018
8f58533
Merge branch 'master' into dev
tschie Oct 25, 2018
75dc3a5
start updates for java 11
tschie Nov 2, 2018
e0e545c
Merge branch 'master' into dev
tschie Nov 12, 2018
8145835
Merge pull request #288 from Esri/master
Rachael-E Nov 19, 2018
a8903f0
update java 11 parts
tschie Nov 26, 2018
82e7a94
add dependencies for all platforms
tschie Nov 26, 2018
2ce991f
Delete module-info.java
tschie Nov 26, 2018
d99fad3
Merge branch 'dev' into java-11
tschie Nov 26, 2018
c8e1c13
Merge branch 'master' into dev
tschie Nov 30, 2018
d45d1ae
Merge branch 'dev' into java-11
tschie Nov 30, 2018
56ed0d5
Merge pull request #289 from Esri/java-11
tschie Nov 30, 2018
52fb4c9
Merge pull request #293 from Esri/master
Rachael-E Dec 12, 2018
42f678b
Merge branch 'master' into dev
tschie Dec 14, 2018
3a22cbb
Merge pull request #298 from Esri/master
Rachael-E Dec 18, 2018
c43331e
Merge branch 'master' into dev
tschie Dec 19, 2018
db8110b
Merge pull request #300 from Esri/master
Rachael-E Dec 21, 2018
9f2204b
Update README
Rachael-E Dec 21, 2018
a56fbdd
Update README.md
tschie Dec 21, 2018
11285fd
Merge pull request #301 from Esri/Rachael-E-patch-1
tschie Dec 21, 2018
894ed41
Merge branch 'master' into dev
tschie Dec 21, 2018
baa2198
add an integrated mesh layer sample
tschie Jan 23, 2019
b133f58
update arcgis version
tschie Jan 23, 2019
5abbed5
use javafx plugin
tschie Jan 23, 2019
2757bb5
Merge branch 'dev' into add-an-integrated-mesh-layer
tschie Jan 23, 2019
0709cbe
Merge branch 'master' into dev
tschie Jan 23, 2019
0da0c29
remove jar task config
tschie Jan 23, 2019
e1edbfe
Merge pull request #306 from Esri/add-an-integrated-mesh-layer
tschie Jan 24, 2019
f93980f
update arcgis version
tschie Jan 31, 2019
f3289a2
move stage show
tschie Jan 31, 2019
426642c
Merge pull request #309 from Esri/master
Rachael-E Feb 1, 2019
32f2a9c
Merge pull request #312 from Esri/master
Rachael-E Feb 5, 2019
b7f9b3e
Merge branch 'master' into dev
tschie Feb 5, 2019
1cb389b
Merge branch 'master' into dev
tschie Feb 5, 2019
9c53786
add point cloud data to sample data downloads
tschie Feb 5, 2019
f75253d
view point cloud data offline sample
tschie Feb 5, 2019
52c3a6d
Update build.gradle
tschie Feb 5, 2019
0a62a7d
change camera viewpoint
tschie Feb 5, 2019
1273c6e
remove unused imports
tschie Feb 5, 2019
1b0a836
update image
tschie Feb 11, 2019
d0776e4
update api version
tschie Feb 11, 2019
6e783c5
Merge pull request #316 from Esri/master
Rachael-E Feb 11, 2019
e4458f6
Merge branch 'master' into dev
tschie Feb 12, 2019
664f09a
edit about the data and additional info sections
tschie Feb 12, 2019
9cb7eae
fix comment
tschie Feb 12, 2019
93ca670
Merge pull request #315 from Esri/view-point-cloud-data-offline
tschie Feb 12, 2019
2c77dbe
Merge pull request #317 from Esri/master
Rachael-E Feb 12, 2019
dbd6a55
Removed errant full stop
Rachael-E Feb 12, 2019
1771bdb
Open Mobile Scene Package (#318)
Rachael-E Feb 20, 2019
3b7f5fe
Merge branch 'master' into dev
tschie Feb 25, 2019
8f9cdce
Map reference scale (#319)
Rachael-E Feb 26, 2019
8f95d99
Corrected title for sample
Rachael-E Mar 12, 2019
a4b8182
Merge master into dev (#322)
Rachael-E Mar 12, 2019
68e1108
Allow downloading of non zip sample data (#324)
tschie Mar 14, 2019
e006134
point scene layer sample (#323)
tschie Mar 15, 2019
f4d7324
Merge master into Dev (#329)
Rachael-E Mar 22, 2019
d144362
remove online elevation data source (#327)
Rachael-E Mar 22, 2019
d3995bf
View content beneath terrain surface (#325)
Rachael-E Mar 25, 2019
4f2f4e4
group layers sample (#331)
tschie Apr 1, 2019
cf7d52a
update version, delete extra copy of samples data
tschie Apr 1, 2019
904fb55
Play kml tours (#332)
tschie Apr 2, 2019
23e4ac2
Generate offline map with local basemap (#330)
Rachael-E Apr 3, 2019
d0c154e
Merge branch 'master' into dev
tschie Apr 4, 2019
3c7277f
pull master
tschie Apr 19, 2019
2aa00c0
Merge branch 'master' into dev
tschie Apr 23, 2019
a49a3c3
Merge branch 'master' into dev
tschie Apr 25, 2019
ba83866
Merging Master into Dev (#345)
JonLavi May 9, 2019
f84ee58
Merge `master` into `dev` (#350)
JonLavi May 17, 2019
dcecafd
merge master into dev
tschie May 28, 2019
573ae5a
Update build.gradle
tschie May 28, 2019
6cd0efc
Allows user to click a value on slider to change exaggeration (#351) …
Rachael-E May 31, 2019
ca64f2f
merge master into dev for ClosestFacilityStatic (#358)
JonLavi Jun 6, 2019
1e9a0e5
Merge branch 'master' into dev
tschie Jun 7, 2019
f876451
merge master into dev (#362)
JonLavi Jun 11, 2019
a82995b
Merge branch 'master' into dev
tschie Jun 12, 2019
1098e89
merge master into dev (#368)
JonLavi Jun 19, 2019
308013d
merge master into dev - oAuth Sample patch (#369)
JonLavi Jun 20, 2019
f3fb3a4
Tschie/split (#387)
tschie Jul 17, 2019
2875d99
fix naming
tschie Jul 18, 2019
9aac5f2
Routing around barriers (#354)
JonLavi Jul 23, 2019
23ec025
Find service areas for multiple facilities (#367)
JonLavi Jul 23, 2019
9bf071f
update screenshot
JonLavi Jul 23, 2019
02b7738
Merge branch 'patch/routing-around-barriers-screenshot' into dev
JonLavi Jul 23, 2019
23866d2
update screenshot
JonLavi Jul 23, 2019
7fbcda6
Fix comment in ColormapRendererSample.java (#391)
philium Jul 23, 2019
43f8fa3
Patch/create and save map - default challenge handler (#388)
JonLavi Jul 24, 2019
f295325
Read symbols from mobile style file (#357)
JonLavi Jul 25, 2019
7b3ca50
Update geopackage sample (#374)
JonLavi Jul 25, 2019
27ad40b
add readme metadata file
tschie Jul 25, 2019
38e3edf
Patch/oauth default challenge handler (#375)
JonLavi Jul 30, 2019
aa285f8
remove extra comma
tschie Jul 31, 2019
1e1c415
Routing around barriers - add isStillSincePress to mouse events (#394)
JonLavi Aug 1, 2019
2288f97
oauth - README.metadata.json formatting (#395)
JonLavi Aug 1, 2019
d2ea64b
mmpk to class member (#398)
JonLavi Aug 6, 2019
f00d337
Patch/dictionary symbol style update constructor (#393)
JonLavi Aug 6, 2019
dc340c2
Patch/geometry engine simplify - add isSimple check (#399)
JonLavi Aug 8, 2019
1a56d07
Integrated windows auth (#370)
JonLavi Aug 8, 2019
2d92654
update README.md for screenshot link (#403)
JonLavi Aug 8, 2019
b209569
Integrated windows auth - update README.metadata.json (#402)
JonLavi Aug 8, 2019
0e5fc1d
move local data download logic to settings.gradle (#401)
tschie Aug 9, 2019
8e43124
fixing data download for mil2505 xml file for sample viewer v2504 (#404)
JonLavi Aug 9, 2019
71375c3
fix typo
tschie Aug 9, 2019
eae4977
fix directory name
tschie Aug 9, 2019
0a4cca8
fix local data folder
tschie Aug 12, 2019
c1c2b6d
put native libraries in .arcgis folder
tschie Aug 13, 2019
5cf8674
Honor mmpk expiration (#397)
JonLavi Aug 13, 2019
959a101
Set annotation sublayer visibility (#396)
JonLavi Aug 13, 2019
a002ce2
Tschie/preplanned map (#405)
tschie Aug 15, 2019
cd1a4cc
Merge branch 'master' into dev
tschie Aug 26, 2019
9ed26f4
ignore iml files
tschie Aug 27, 2019
a0f2be8
Create and save kml file (#406)
JonLavi Aug 28, 2019
f9e744d
Apply scheduled updates to preplanned map area (#392)
JonLavi Sep 25, 2019
009b2f3
Patch/apply scheduled updates (#412)
JonLavi Oct 3, 2019
95f1ee9
Data parent directory (#413)
tschie Oct 22, 2019
f34287c
specify parent directory in File constructor
tschie Oct 22, 2019
2ef5f63
avoid explicit list of excluded directories
tschie Oct 22, 2019
6d0ef08
Merge branch 'master' into dev
tschie Oct 23, 2019
01a9bf8
show progress indicator on initial load
tschie Oct 23, 2019
bdb6833
Jon/remove unpack workflow2 (#422)
JonLavi Nov 20, 2019
8bb879c
Custom dictionary style [into dev] (#421)
JonLavi Nov 20, 2019
7ecda20
Edit kml ground overlay [into dev] (#420)
JonLavi Nov 20, 2019
afdb75a
Merge branch 'master' into dev
tschie Nov 20, 2019
d521670
add panel-region class to vbox
tschie Nov 20, 2019
e06c5fa
Display subtype feature layer (#427)
Rachael-E Dec 17, 2019
dc232c2
New Sample - Find connected features in utility network (#419)
JonLavi Jan 7, 2020
1ce5952
Update dev (#434)
Rachael-E Jan 7, 2020
60b2aae
display subtype feature layer - remove duplicate folder [dev] (#436)
JonLavi Jan 7, 2020
9d3158f
Merge branch 'master' into dev
tschie Jan 7, 2020
050dadb
Merge branch 'master' into dev
Rachael-E Feb 19, 2020
7560e54
Sync Dev with Master (#464)
JonLavi Mar 25, 2020
412037a
Merge branch 'master' into dev
tschie Apr 7, 2020
fd3a211
Fclfp hardik (#463)
Apr 13, 2020
2a85c90
Merge branch 'master' into dev
tschie Apr 20, 2020
ce35ebf
Merge branch 'master' into dev
tschie Apr 23, 2020
933dacc
Sync master into dev (#494)
JonLavi Apr 24, 2020
98cceae
Merge branch 'master' into dev
tschie Jun 8, 2020
e879c11
Merge branch 'master' into dev
tschie Jun 12, 2020
74ffdfc
Merge branch 'master' into dev
Rachael-E Jul 6, 2020
d9a13ff
Merge branch 'master' into dev
Jul 7, 2020
cddacc4
Update gradle and javafx versions (#527)
JonLavi Jul 16, 2020
4e27813
sync dev with master (#530)
JonLavi Jul 16, 2020
37114d2
Merge branch 'master' into dev
Rachael-E Jul 23, 2020
c8e6633
fix keywords in metadata.json
JonLavi Jul 23, 2020
57d0aba
fix metadata file path, title, redirect (#535)
JonLavi Jul 23, 2020
f18496b
Merge remote-tracking branch 'origin/master' into dev
JonLavi Jul 27, 2020
14ee78b
Feature enhancement to Surface Placement (#531)
jenmerritt Jul 28, 2020
b06ca29
New Sample: Realistic Lighting and Shadows (#528)
sclaridge Jul 28, 2020
279eb0e
Set up feature linked annotation sample
sclaridge Jul 28, 2020
d8d4ea8
Create EditFeaturesWithFeatureLinkedAnnotationController.java
sclaridge Jul 28, 2020
74e1edf
Add main.fxml
sclaridge Jul 28, 2020
01ebc13
Create dialog window in fxml
sclaridge Jul 28, 2020
5137779
Update EditFeaturesWithFeatureLinkedAnnotationController.java
sclaridge Jul 28, 2020
f1de75f
Create loudoun_anno.geodatabase
sclaridge Jul 28, 2020
688ddf5
Update readme and comments
sclaridge Jul 29, 2020
a51e9f5
Update README.metadata.json (#541)
sclaridge Jul 29, 2020
06ff35d
move some slider styling into fxml file to fix sample viewer display …
jenmerritt Jul 29, 2020
f0a36ec
Add gif and png
sclaridge Jul 29, 2020
dd6fb3e
Rename edit_attributes_dialog.fxml
sclaridge Jul 29, 2020
c1f08b2
Create identify and select feature methods
sclaridge Aug 3, 2020
7274f80
Add updateAttributes method
sclaridge Aug 3, 2020
c62ed03
Select top layer in identifyFeature()
sclaridge Aug 4, 2020
ed33b20
Change import order
sclaridge Aug 4, 2020
4f56af5
Merge changes to dev
sclaridge Aug 4, 2020
4fe4d00
Remove gif and fix README metadata
sclaridge Aug 5, 2020
5471cbb
Move application code from the controller
sclaridge Aug 6, 2020
4d93b19
Create loudoun_anno.geodatabase
sclaridge Aug 6, 2020
555a2a7
Add param javadoc comments
sclaridge Aug 7, 2020
9c0abee
Edit method comments
sclaridge Aug 10, 2020
aed897b
Update README.metadata.json
sclaridge Aug 10, 2020
0e27fd3
Update feature in showEditableAttributes
sclaridge Aug 10, 2020
d0b7494
Add changes from PR
sclaridge Aug 14, 2020
3aca50f
Change settings.gradle to store data in samples-data directory
sclaridge Sep 1, 2020
57e046f
Merge branch 'master' into sim11117-feature-linked-annotation
sclaridge Sep 2, 2020
a96616d
Update build.gradle
sclaridge Sep 2, 2020
4c38e39
Commit changes from PR
sclaridge Sep 4, 2020
a97213a
Update image
sclaridge Sep 4, 2020
188058d
Add changes from PR
sclaridge Sep 8, 2020
9d311cd
Remove single use methods
sclaridge Sep 8, 2020
747115a
Change comments
sclaridge Sep 8, 2020
924c240
Cast with toIntExact
sclaridge Sep 8, 2020
ef9b019
Remove geodatabase and update comments
sclaridge Sep 9, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions editing/edit-features-with-feature-linked-annotation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Edit features with feature-linked annotation

Edit feature attributes which are linked to annotation through an expression.

![Image of edit features with feature-linked annotation](EditFeaturesWithFeatureLinkedAnnotation.png)

## Use case

Annotation is useful for displaying text that you don't want to move or resize when the map is panned or zoomed (unlike labels which will move and resize). Feature-linked annotation will update when a feature attribute referenced by the annotation expression is also updated. Additionally, the position of the annotation will transform to match any transformation to the linked feature's geometry.

## How to use the sample

Pan and zoom the map to see that the text on the map is annotation, not labels. Click one of the address points to update the house number (AD_ADDRESS) and street name (ST_STR_NAM). Once you have edited the feature attributes, click "Update" and then click again on the map to move the address point to a new location. You can also click one of the dashed parcel polylines and click another location to change its geometry and update its annotation (distance in feet). NOTE: Selection is only enabled for points and straight (single segment) polylines.
The feature-linked annotation will update accordingly.

## How it works

1. Load the geodatabase. NOTE: Read/write geodatabases should normally come from a `GeodatabaseSyncTask`, but this has been omitted here. That functionality is covered in the sample *Generate geodatabase*.
2. Create `FeatureLayer`s from `GeodatabaseFeatureTable`s found in the geodatabase with `Geodatabase.getGeodatabaseFeatureTable()`.
3. Create `AnnotationLayer`s from `GeodatabaseFeatureTable`s found in the geodatabase with `Geodatabase.getGeodatabaseAnnotationTables()`.
4. Add the `FeatureLayer`s and `AnnotationLayer`s to the map's operational layers.
5. Use `MapView.setOnMouseClicked()` to handle clicks on the map to either select address points or parcel polyline features. NOTE: Selection is only enabled for points and straight (single segment) polylines.
6. For the address points, a dialog opens to allow editing of the address number (AD_ADDRESS) and street name (ST_STR_NAM) attributes, which use the expression `$feature.AD_ADDRESS + " " + $feature.ST_STR_NAM` for annotation.
7. For the parcel lines, a second mouse click will change one of the polyline's vertices. Note that the dimension annotation updates according to the expression `Round(Length(Geometry($feature), 'feet'), 2)`.

Both expressions were defined by the data author in ArcGIS Pro using [the Arcade expression language](https://developers.arcgis.com/arcade/).

## Relevant API

* AnnotationLayer
* Feature
* FeatureLayer
* Geodatabase

## About the data

This sample uses data derived from the [Loudoun GeoHub](https://geohub-loudoungis.opendata.arcgis.com/).

## Tags

annotation, attributes, features, feature-linked annotation, fields
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"category": "Editing",
"description": "Edit feature attributes which are linked to annotation through an expression.",
"ignore": false,
"images": [
"EditFeaturesWithFeatureLinkedAnnotation.png"
],
"keywords": [
"annotation",
"attributes",
"feature-linked annotation",
"features",
"fields",
"AnnotationLayer",
"Feature",
"FeatureLayer",
"Geodatabase"
],
"redirect_from": [],
"relevant_apis": [
"AnnotationLayer",
"Feature",
"FeatureLayer",
"Geodatabase"
],
"snippets": [
"src/main/java/com.esri.samples.edit_features_with_feature_linked_annotation/EditAttributesDialog.java",
"src/main/java/com.esri.samples.edit_features_with_feature_linked_annotation/EditFeaturesWithFeatureLinkedAnnotationSample.java",
"src/main/resources/edit_features_with_feature_linked_annotation/edit_attributes_dialog.fxml"
],
"title": "Edit features with feature-linked annotation"
}
77 changes: 77 additions & 0 deletions editing/edit-features-with-feature-linked-annotation/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
plugins {
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.5'
}

group = 'com.esri.samples'

ext {
arcgisVersion = '100.9.0'
}

javafx {
version = "11.0.2"
modules = [ 'javafx.controls', 'javafx.fxml' ]
}

compileJava.options.encoding = 'UTF-8'

repositories {
jcenter()
maven {
url 'https://esri.bintray.com/arcgis'
}
maven {
url 'http://olympus.esri.com/artifactory/arcgisruntime-repo'
}
}

configurations {
natives
}

dependencies {
compile "com.esri.arcgisruntime:arcgis-java:$arcgisVersion"
natives "com.esri.arcgisruntime:arcgis-java-jnilibs:$arcgisVersion"
natives "com.esri.arcgisruntime:arcgis-java-resources:$arcgisVersion"
}

task copyNatives(type: Copy) {
description = "Copies the arcgis native libraries into the project build directory for development."
group = "build"
configurations.natives.asFileTree.each {
from(zipTree(it))
}
// store native libraries in a common location shared with other samples
into "${System.properties.getProperty("user.home")}/.arcgis/$arcgisVersion"
}

run {
dependsOn copyNatives
mainClassName = 'com.esri.samples.edit_features_with_feature_linked_annotation.EditFeaturesWithFeatureLinkedAnnotationLauncher'
}

jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes("Main-Class": "$mainClassName")
}
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
}

task productionZip(type: Zip) {
group = 'distribution'
from ("samples-data") {
into "samples-data"
}
from copyNatives
from jar.destinationDir
into (project.name)
baseName = project.name
}

wrapper {
gradleVersion = '6.5.1'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
172 changes: 172 additions & 0 deletions editing/edit-features-with-feature-linked-annotation/gradlew
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
#!/usr/bin/env sh

##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn () {
echo "$*"
}

die () {
echo
echo "$*"
echo
exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option

if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
Loading