Skip to content

Commit 1330d1c

Browse files
author
john0005
committed
Raster samples Copyright
1 parent 1ec83ff commit 1330d1c

File tree

10 files changed

+62
-48
lines changed

10 files changed

+62
-48
lines changed

src/main/java/com/esri/samples/raster/blend_renderer/BlendRendererController.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 Esri.
2+
* Copyright 2017 Esri.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
55
* use this file except in compliance with the License. You may obtain a copy of
@@ -85,12 +85,10 @@ public void initialize() {
8585
*/
8686
public void updateRenderer() {
8787

88-
ColorRamp colorRamp = colorRampComboBox.getSelectionModel().getSelectedItem() != ColorRamp.PresetType.NONE ?
89-
new ColorRamp(colorRampComboBox.getSelectionModel().getSelectedItem(), 800) : null;
88+
ColorRamp colorRamp = colorRampComboBox.getSelectionModel().getSelectedItem() != ColorRamp.PresetType.NONE ? new ColorRamp(colorRampComboBox.getSelectionModel().getSelectedItem(), 800) : null;
9089

9190
// if color ramp is not NONE, color the hillshade elevation raster instead of using satellite imagery raster color
92-
RasterLayer rasterLayer = colorRamp != null ?
93-
new RasterLayer(new Raster(elevationRasterPath)) : new RasterLayer(new Raster(imageryRasterPath));
91+
RasterLayer rasterLayer = colorRamp != null ? new RasterLayer(new Raster(elevationRasterPath)) : new RasterLayer(new Raster(imageryRasterPath));
9492

9593
mapView.getMap().setBasemap(new Basemap(rasterLayer));
9694

src/main/java/com/esri/samples/raster/blend_renderer/BlendRendererSample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 Esri.
2+
* Copyright 2017 Esri.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
55
* use this file except in compliance with the License. You may obtain a copy of

src/main/java/com/esri/samples/raster/colormap_renderer/ColormapRendererSample.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 Esri.
2+
* Copyright 2017 Esri.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
55
* use this file except in compliance with the License. You may obtain a copy of
@@ -21,18 +21,18 @@
2121
import java.util.stream.Collectors;
2222
import java.util.stream.IntStream;
2323

24+
import javafx.application.Application;
25+
import javafx.scene.Scene;
26+
import javafx.scene.layout.StackPane;
27+
import javafx.stage.Stage;
28+
2429
import com.esri.arcgisruntime.layers.RasterLayer;
2530
import com.esri.arcgisruntime.mapping.ArcGISMap;
2631
import com.esri.arcgisruntime.mapping.Basemap;
2732
import com.esri.arcgisruntime.mapping.view.MapView;
2833
import com.esri.arcgisruntime.raster.ColormapRenderer;
2934
import com.esri.arcgisruntime.raster.Raster;
3035

31-
import javafx.application.Application;
32-
import javafx.scene.Scene;
33-
import javafx.scene.layout.StackPane;
34-
import javafx.stage.Stage;
35-
3636
public class ColormapRendererSample extends Application {
3737

3838
private MapView mapView;

src/main/java/com/esri/samples/raster/hillshade_renderer/HillshadeRendererController.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 Esri.
2+
* Copyright 2017 Esri.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
55
* use this file except in compliance with the License. You may obtain a copy of
@@ -18,15 +18,17 @@
1818

1919
import java.io.File;
2020

21+
import javafx.fxml.FXML;
22+
import javafx.scene.control.ComboBox;
23+
import javafx.scene.control.Slider;
24+
2125
import com.esri.arcgisruntime.layers.RasterLayer;
2226
import com.esri.arcgisruntime.mapping.ArcGISMap;
2327
import com.esri.arcgisruntime.mapping.Basemap;
2428
import com.esri.arcgisruntime.mapping.view.MapView;
25-
import com.esri.arcgisruntime.raster.*;
26-
27-
import javafx.fxml.FXML;
28-
import javafx.scene.control.ComboBox;
29-
import javafx.scene.control.Slider;
29+
import com.esri.arcgisruntime.raster.HillshadeRenderer;
30+
import com.esri.arcgisruntime.raster.Raster;
31+
import com.esri.arcgisruntime.raster.SlopeType;
3032

3133
public class HillshadeRendererController {
3234

src/main/java/com/esri/samples/raster/hillshade_renderer/HillshadeRendererSample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 Esri.
2+
* Copyright 2017 Esri.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
55
* use this file except in compliance with the License. You may obtain a copy of

src/main/java/com/esri/samples/raster/raster_layer_file/RasterLayerFileSample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 Esri.
2+
* Copyright 2017 Esri.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
55
* use this file except in compliance with the License. You may obtain a copy of
@@ -96,4 +96,4 @@ public static void main(String[] args) {
9696
Application.launch(args);
9797
}
9898

99-
}
99+
}

src/main/java/com/esri/samples/raster/rgb_renderer/RgbRendererController.java

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 Esri.
2+
* Copyright 2017 Esri.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
55
* use this file except in compliance with the License. You may obtain a copy of
@@ -19,18 +19,23 @@
1919
import java.io.File;
2020
import java.util.Arrays;
2121

22-
import com.esri.arcgisruntime.layers.RasterLayer;
23-
import com.esri.arcgisruntime.mapping.ArcGISMap;
24-
import com.esri.arcgisruntime.mapping.Basemap;
25-
import com.esri.arcgisruntime.mapping.view.MapView;
26-
import com.esri.arcgisruntime.raster.*;
27-
2822
import javafx.beans.binding.Bindings;
2923
import javafx.beans.binding.BooleanBinding;
3024
import javafx.fxml.FXML;
3125
import javafx.scene.control.ComboBox;
3226
import javafx.scene.control.Spinner;
3327

28+
import com.esri.arcgisruntime.layers.RasterLayer;
29+
import com.esri.arcgisruntime.mapping.ArcGISMap;
30+
import com.esri.arcgisruntime.mapping.Basemap;
31+
import com.esri.arcgisruntime.mapping.view.MapView;
32+
import com.esri.arcgisruntime.raster.MinMaxStretchParameters;
33+
import com.esri.arcgisruntime.raster.PercentClipStretchParameters;
34+
import com.esri.arcgisruntime.raster.RGBRenderer;
35+
import com.esri.arcgisruntime.raster.Raster;
36+
import com.esri.arcgisruntime.raster.StandardDeviationStretchParameters;
37+
import com.esri.arcgisruntime.raster.StretchParameters;
38+
3439
public class RgbRendererController {
3540

3641
@FXML private MapView mapView;
@@ -67,24 +72,21 @@ public void initialize() {
6772
stretchTypeComboBox.getSelectionModel().select("MinMax");
6873

6974
// bindings
70-
BooleanBinding minMaxStretchBinding = Bindings.createBooleanBinding(() ->
71-
!"MinMax".equals(stretchTypeComboBox.getSelectionModel().getSelectedItem()), stretchTypeComboBox
75+
BooleanBinding minMaxStretchBinding = Bindings.createBooleanBinding(() -> !"MinMax".equals(stretchTypeComboBox.getSelectionModel().getSelectedItem()), stretchTypeComboBox
7276
.getSelectionModel().selectedItemProperty());
7377
minRedSpinner.disableProperty().bind(minMaxStretchBinding);
7478
minGreenSpinner.disableProperty().bind(minMaxStretchBinding);
7579
minBlueSpinner.disableProperty().bind(minMaxStretchBinding);
7680
maxRedSpinner.disableProperty().bind(minMaxStretchBinding);
7781
maxGreenSpinner.disableProperty().bind(minMaxStretchBinding);
7882
maxBlueSpinner.disableProperty().bind(minMaxStretchBinding);
79-
BooleanBinding percentClipStretchBinding = Bindings.createBooleanBinding(() ->
80-
!"PercentClip".equals(stretchTypeComboBox.getSelectionModel().getSelectedItem()), stretchTypeComboBox
83+
BooleanBinding percentClipStretchBinding = Bindings.createBooleanBinding(() -> !"PercentClip".equals(stretchTypeComboBox.getSelectionModel().getSelectedItem()), stretchTypeComboBox
8184
.getSelectionModel().selectedItemProperty());
8285
minPercentSpinner.disableProperty().bind(percentClipStretchBinding);
8386
maxPercentSpinner.disableProperty().bind(percentClipStretchBinding);
84-
BooleanBinding stdDeviationStretchBinding = Bindings.createBooleanBinding(() ->
85-
!"StdDeviation".equals(stretchTypeComboBox.getSelectionModel().getSelectedItem()), stretchTypeComboBox
87+
BooleanBinding stdDeviationStretchBinding = Bindings.createBooleanBinding(() -> !"StdDeviation".equals(stretchTypeComboBox.getSelectionModel().getSelectedItem()), stretchTypeComboBox
8688
.getSelectionModel().selectedItemProperty());
87-
factorSpinner.disableProperty().bind(stdDeviationStretchBinding);
89+
factorSpinner.disableProperty().bind(stdDeviationStretchBinding);
8890

8991
// add listeners
9092
factorSpinner.valueProperty().addListener(o -> updateRenderer());
@@ -116,9 +118,12 @@ public void updateRenderer() {
116118

117119
StretchParameters stretchParameters;
118120
switch (stretchTypeComboBox.getSelectionModel().getSelectedItem()) {
119-
case "MinMax": stretchParameters = new MinMaxStretchParameters(Arrays.asList(minR, minG, minB), Arrays.asList
120-
(maxR, maxG, maxB)); break;
121-
case "PercentClip":stretchParameters = new PercentClipStretchParameters(minP, maxP); break;
121+
case "MinMax":
122+
stretchParameters = new MinMaxStretchParameters(Arrays.asList(minR, minG, minB), Arrays.asList(maxR, maxG, maxB));
123+
break;
124+
case "PercentClip":
125+
stretchParameters = new PercentClipStretchParameters(minP, maxP);
126+
break;
122127
default:
123128
stretchParameters = new StandardDeviationStretchParameters(factorSpinner.getValue());
124129
}

src/main/java/com/esri/samples/raster/rgb_renderer/RgbRendererSample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 Esri.
2+
* Copyright 2017 Esri.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
55
* use this file except in compliance with the License. You may obtain a copy of

src/main/java/com/esri/samples/raster/stretch_renderer/StretchRendererController.java

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 Esri.
2+
* Copyright 2017 Esri.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
55
* use this file except in compliance with the License. You may obtain a copy of
@@ -19,15 +19,20 @@
1919
import java.io.File;
2020
import java.util.Arrays;
2121

22+
import javafx.fxml.FXML;
23+
import javafx.scene.control.ComboBox;
24+
import javafx.scene.control.Slider;
25+
2226
import com.esri.arcgisruntime.layers.RasterLayer;
2327
import com.esri.arcgisruntime.mapping.ArcGISMap;
2428
import com.esri.arcgisruntime.mapping.Basemap;
2529
import com.esri.arcgisruntime.mapping.view.MapView;
26-
import com.esri.arcgisruntime.raster.*;
27-
28-
import javafx.fxml.FXML;
29-
import javafx.scene.control.ComboBox;
30-
import javafx.scene.control.Slider;
30+
import com.esri.arcgisruntime.raster.MinMaxStretchParameters;
31+
import com.esri.arcgisruntime.raster.PercentClipStretchParameters;
32+
import com.esri.arcgisruntime.raster.Raster;
33+
import com.esri.arcgisruntime.raster.StandardDeviationStretchParameters;
34+
import com.esri.arcgisruntime.raster.StretchParameters;
35+
import com.esri.arcgisruntime.raster.StretchRenderer;
3136

3237
public class StretchRendererController {
3338

@@ -92,8 +97,12 @@ public void updateRenderer() {
9297

9398
StretchParameters stretchParameters;
9499
switch (stretchTypeComboBox.getSelectionModel().getSelectedItem()) {
95-
case "MinMax": stretchParameters = new MinMaxStretchParameters(Arrays.asList(min), Arrays.asList(max)); break;
96-
case "PercentClip": stretchParameters = new PercentClipStretchParameters(min, max); break;
100+
case "MinMax":
101+
stretchParameters = new MinMaxStretchParameters(Arrays.asList(min), Arrays.asList(max));
102+
break;
103+
case "PercentClip":
104+
stretchParameters = new PercentClipStretchParameters(min, max);
105+
break;
97106
default:
98107
minSlider.setDisable(true);
99108
maxSlider.setDisable(true);

src/main/java/com/esri/samples/raster/stretch_renderer/StretchRendererSample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 Esri.
2+
* Copyright 2017 Esri.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
55
* use this file except in compliance with the License. You may obtain a copy of

0 commit comments

Comments
 (0)