Skip to content

Commit 2158b6e

Browse files
committed
change controlsVBox background style
1 parent 7698018 commit 2158b6e

File tree

21 files changed

+279
-144
lines changed

21 files changed

+279
-144
lines changed

src/main/java/com/esri/samples/analysis/analyze_hotspots/AnalyzeHotspotsSample.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,12 @@
2929
import javafx.scene.control.Button;
3030
import javafx.scene.control.DatePicker;
3131
import javafx.scene.control.ProgressIndicator;
32+
import javafx.scene.layout.Background;
33+
import javafx.scene.layout.BackgroundFill;
34+
import javafx.scene.layout.CornerRadii;
3235
import javafx.scene.layout.StackPane;
3336
import javafx.scene.layout.VBox;
37+
import javafx.scene.paint.Paint;
3438
import javafx.stage.Stage;
3539

3640
import com.esri.arcgisruntime.concurrent.Job;
@@ -93,7 +97,10 @@ public void start(Stage stage) {
9397
analyzeButton.setDisable(true);
9498

9599
VBox controlsVBox = new VBox(6);
96-
controlsVBox.setMaxSize(180, 250);
100+
controlsVBox.setBackground(new Background(new BackgroundFill(Paint.valueOf("rgba(0,0,0,0.3)"), CornerRadii.EMPTY,
101+
Insets.EMPTY)));
102+
controlsVBox.setPadding(new Insets(10.0));
103+
controlsVBox.setMaxSize(180, 110);
97104
controlsVBox.getChildren().addAll(begDatePicker, endDatePicker, analyzeButton);
98105

99106
// and the mapView, controls, and progress indicator to the stack pane

src/main/java/com/esri/samples/displayinformation/update_graphics/UpdateGraphicsSample.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,12 @@
3131
import javafx.scene.control.Label;
3232
import javafx.scene.control.TextInputDialog;
3333
import javafx.scene.input.MouseButton;
34+
import javafx.scene.layout.Background;
35+
import javafx.scene.layout.BackgroundFill;
36+
import javafx.scene.layout.CornerRadii;
3437
import javafx.scene.layout.StackPane;
3538
import javafx.scene.layout.VBox;
39+
import javafx.scene.paint.Paint;
3640
import javafx.stage.Stage;
3741

3842
import com.esri.arcgisruntime.concurrent.ListenableFuture;
@@ -80,9 +84,12 @@ public void start(Stage stage) {
8084
stage.show();
8185

8286
// create a control panel
83-
VBox vBoxControl = new VBox(6);
84-
vBoxControl.setMaxSize(180, 150);
85-
vBoxControl.getStyleClass().add("panel-region");
87+
VBox controlsVBox = new VBox(6);
88+
controlsVBox.setBackground(new Background(new BackgroundFill(Paint.valueOf("rgba(0,0,0,0.3)"), CornerRadii.EMPTY,
89+
Insets.EMPTY)));
90+
controlsVBox.setPadding(new Insets(10.0));
91+
controlsVBox.setMaxSize(180, 150);
92+
controlsVBox.getStyleClass().add("panel-region");
8693

8794
// create buttons for user interaction
8895
Button updateLocationButton = new Button("Update Location");
@@ -138,7 +145,7 @@ public void start(Stage stage) {
138145
});
139146

140147
// add label, dropdown and buttons to the control panel
141-
vBoxControl.getChildren().addAll(updateLocationButton, updateDescriptionButton, symbolLabel, symbolBox);
148+
controlsVBox.getChildren().addAll(updateLocationButton, updateDescriptionButton, symbolLabel, symbolBox);
142149

143150
// create a graphics overlay
144151
graphicsOverlay = new GraphicsOverlay();
@@ -205,9 +212,9 @@ public void start(Stage stage) {
205212
});
206213

207214
// add the map view and control panel to stack pane
208-
stackPane.getChildren().addAll(mapView, vBoxControl);
209-
StackPane.setAlignment(vBoxControl, Pos.TOP_LEFT);
210-
StackPane.setMargin(vBoxControl, new Insets(10, 0, 0, 10));
215+
stackPane.getChildren().addAll(mapView, controlsVBox);
216+
StackPane.setAlignment(controlsVBox, Pos.TOP_LEFT);
217+
StackPane.setMargin(controlsVBox, new Insets(10, 0, 0, 10));
211218
} catch (Exception e) {
212219
// on any error, display the stack trace
213220
e.printStackTrace();

src/main/java/com/esri/samples/editing/edit_feature_attachments/EditFeatureAttachmentsSample.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@
3030
import javafx.scene.control.Label;
3131
import javafx.scene.control.ListView;
3232
import javafx.scene.input.MouseButton;
33+
import javafx.scene.layout.Background;
34+
import javafx.scene.layout.BackgroundFill;
35+
import javafx.scene.layout.CornerRadii;
3336
import javafx.scene.layout.StackPane;
3437
import javafx.scene.layout.VBox;
38+
import javafx.scene.paint.Paint;
3539
import javafx.stage.Stage;
3640

3741
import org.apache.commons.io.IOUtils;
@@ -83,9 +87,12 @@ public void start(Stage stage) {
8387
stage.show();
8488

8589
// create a control panel
86-
VBox vBoxControl = new VBox(6);
87-
vBoxControl.setMaxSize(180, 250);
88-
vBoxControl.getStyleClass().add("panel-region");
90+
VBox controlsVBox = new VBox(6);
91+
controlsVBox.setBackground(new Background(new BackgroundFill(Paint.valueOf("rgba(0,0,0,0.3)"), CornerRadii.EMPTY,
92+
Insets.EMPTY)));
93+
controlsVBox.setPadding(new Insets(10.0));
94+
controlsVBox.setMaxSize(180, 250);
95+
controlsVBox.getStyleClass().add("panel-region");
8996

9097
// create a list to show selected feature's attachments
9198
attachmentList = new ListView<>();
@@ -112,7 +119,7 @@ public void start(Stage stage) {
112119
deleteAttachmentButton.setOnAction(e -> deleteAttachment(attachmentList.getSelectionModel().getSelectedIndex()));
113120

114121
// add controls to the panel
115-
vBoxControl.getChildren().addAll(addAttachmentButton, deleteAttachmentButton, attachmentsLabel, attachmentList);
122+
controlsVBox.getChildren().addAll(addAttachmentButton, deleteAttachmentButton, attachmentsLabel, attachmentList);
116123

117124
// create a map with streets basemap
118125
ArcGISMap map = new ArcGISMap(Basemap.Type.STREETS, 40, -95, 4);
@@ -178,9 +185,9 @@ public void start(Stage stage) {
178185
});
179186

180187
// add map view and control panel to stack pane
181-
stackPane.getChildren().addAll(mapView, vBoxControl);
182-
StackPane.setAlignment(vBoxControl, Pos.TOP_LEFT);
183-
StackPane.setMargin(vBoxControl, new Insets(10, 0, 0, 10));
188+
stackPane.getChildren().addAll(mapView, controlsVBox);
189+
StackPane.setAlignment(controlsVBox, Pos.TOP_LEFT);
190+
StackPane.setMargin(controlsVBox, new Insets(10, 0, 0, 10));
184191
} catch (Exception e) {
185192
e.printStackTrace();
186193
}

src/main/java/com/esri/samples/editing/update_attributes/UpdateAttributesSample.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,12 @@
3131
import javafx.scene.control.ComboBox;
3232
import javafx.scene.control.Label;
3333
import javafx.scene.input.MouseButton;
34+
import javafx.scene.layout.Background;
35+
import javafx.scene.layout.BackgroundFill;
36+
import javafx.scene.layout.CornerRadii;
3437
import javafx.scene.layout.StackPane;
3538
import javafx.scene.layout.VBox;
39+
import javafx.scene.paint.Paint;
3640
import javafx.stage.Stage;
3741

3842
import com.esri.arcgisruntime.concurrent.ListenableFuture;
@@ -76,9 +80,12 @@ public void start(Stage stage) {
7680
stage.show();
7781

7882
// create a control panel
79-
VBox vBoxControl = new VBox(6);
80-
vBoxControl.setMaxSize(180, 80);
81-
vBoxControl.getStyleClass().add("panel-region");
83+
VBox controlsVBox = new VBox(6);
84+
controlsVBox.setBackground(new Background(new BackgroundFill(Paint.valueOf("rgba(0,0,0,0.3)"), CornerRadii.EMPTY,
85+
Insets.EMPTY)));
86+
controlsVBox.setPadding(new Insets(10.0));
87+
controlsVBox.setMaxSize(180, 80);
88+
controlsVBox.getStyleClass().add("panel-region");
8289

8390
// create damage type label
8491
Label typeDamageLabel = new Label("Damage type:");
@@ -109,7 +116,7 @@ public void start(Stage stage) {
109116
});
110117

111118
// add damage type label and comboBox to the control panel
112-
vBoxControl.getChildren().addAll(typeDamageLabel, comboBox);
119+
controlsVBox.getChildren().addAll(typeDamageLabel, comboBox);
113120

114121
// create a map with streets basemap
115122
ArcGISMap map = new ArcGISMap(Basemap.Type.STREETS, 40, -95, 4);
@@ -170,9 +177,9 @@ public void start(Stage stage) {
170177
mapView.setMap(map);
171178

172179
// add the map view and control box to stack pane
173-
stackPane.getChildren().addAll(mapView, vBoxControl);
174-
StackPane.setAlignment(vBoxControl, Pos.TOP_LEFT);
175-
StackPane.setMargin(vBoxControl, new Insets(10, 0, 0, 10));
180+
stackPane.getChildren().addAll(mapView, controlsVBox);
181+
StackPane.setAlignment(controlsVBox, Pos.TOP_LEFT);
182+
StackPane.setMargin(controlsVBox, new Insets(10, 0, 0, 10));
176183

177184
} catch (Exception e) {
178185
// on any error, display the stack trace

src/main/java/com/esri/samples/featurelayers/feature_layer_extrusion/FeatureLayerExtrusionSample.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,12 @@
2121
import javafx.geometry.Pos;
2222
import javafx.scene.Scene;
2323
import javafx.scene.control.Button;
24+
import javafx.scene.layout.Background;
25+
import javafx.scene.layout.BackgroundFill;
26+
import javafx.scene.layout.CornerRadii;
2427
import javafx.scene.layout.StackPane;
2528
import javafx.scene.layout.VBox;
29+
import javafx.scene.paint.Paint;
2630
import javafx.stage.Stage;
2731

2832
import com.esri.arcgisruntime.data.ServiceFeatureTable;
@@ -87,12 +91,15 @@ public void start(Stage stage) {
8791
sceneView.setCameraController(orbitCamera);
8892

8993
// create a control panel
90-
VBox vBoxControl = new VBox();
91-
vBoxControl.setMaxSize(200, 40);
92-
vBoxControl.getStyleClass().add("panel-region");
93-
stackPane.getChildren().add(vBoxControl);
94-
StackPane.setAlignment(vBoxControl, Pos.TOP_LEFT);
95-
StackPane.setMargin(vBoxControl, new Insets(10, 0, 0, 10));
94+
VBox controlsVBox = new VBox();
95+
controlsVBox.setBackground(new Background(new BackgroundFill(Paint.valueOf("rgba(0,0,0,0.3)"), CornerRadii.EMPTY,
96+
Insets.EMPTY)));
97+
controlsVBox.setPadding(new Insets(10.0));
98+
controlsVBox.setMaxSize(200, 40);
99+
controlsVBox.getStyleClass().add("panel-region");
100+
stackPane.getChildren().add(controlsVBox);
101+
StackPane.setAlignment(controlsVBox, Pos.TOP_LEFT);
102+
StackPane.setMargin(controlsVBox, new Insets(10, 0, 0, 10));
96103

97104
// controls for extruding by total population or by population density
98105
Button extrusionButton = new Button("Population Density");
@@ -111,7 +118,7 @@ public void start(Stage stage) {
111118
});
112119
extrusionButton.setMaxWidth(Double.MAX_VALUE);
113120
extrusionButton.fire();
114-
vBoxControl.getChildren().add(extrusionButton);
121+
controlsVBox.getChildren().add(extrusionButton);
115122
}
116123

117124
/**

src/main/java/com/esri/samples/featurelayers/feature_layer_query/FeatureLayerQuerySample.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,13 @@
2626
import javafx.scene.control.Button;
2727
import javafx.scene.control.Label;
2828
import javafx.scene.control.TextField;
29+
import javafx.scene.layout.Background;
30+
import javafx.scene.layout.BackgroundFill;
31+
import javafx.scene.layout.CornerRadii;
2932
import javafx.scene.layout.HBox;
3033
import javafx.scene.layout.StackPane;
3134
import javafx.scene.layout.VBox;
35+
import javafx.scene.paint.Paint;
3236
import javafx.stage.Stage;
3337

3438
import com.esri.arcgisruntime.concurrent.ListenableFuture;
@@ -79,9 +83,12 @@ public void start(Stage stage) {
7983
stage.show();
8084

8185
// create a control panel
82-
VBox vBoxControl = new VBox(6);
83-
vBoxControl.setMaxSize(250, 80);
84-
vBoxControl.getStyleClass().add("panel-region");
86+
VBox controlsVBox = new VBox(6);
87+
controlsVBox.setBackground(new Background(new BackgroundFill(Paint.valueOf("rgba(0,0,0,0.3)"), CornerRadii.EMPTY,
88+
Insets.EMPTY)));
89+
controlsVBox.setPadding(new Insets(10.0));
90+
controlsVBox.setMaxSize(250, 80);
91+
controlsVBox.getStyleClass().add("panel-region");
8592

8693
// create area for searching
8794
Label searchLabel = new Label("Search for a State:");
@@ -112,7 +119,7 @@ public void start(Stage stage) {
112119
});
113120

114121
// add search label and box to the control panel
115-
vBoxControl.getChildren().addAll(searchLabel, searchBox);
122+
controlsVBox.getChildren().addAll(searchLabel, searchBox);
116123

117124
// create a starting point for the view
118125
startPoint = new Point(-11000000, 5000000, SpatialReferences.getWebMercator());
@@ -156,9 +163,9 @@ public void start(Stage stage) {
156163
mapView.setViewpointCenterAsync(startPoint, SCALE);
157164

158165
// add the map view and control panel to stack pane
159-
stackPane.getChildren().addAll(mapView, vBoxControl);
160-
StackPane.setAlignment(vBoxControl, Pos.TOP_LEFT);
161-
StackPane.setMargin(vBoxControl, new Insets(10, 0, 0, 10));
166+
stackPane.getChildren().addAll(mapView, controlsVBox);
167+
StackPane.setAlignment(controlsVBox, Pos.TOP_LEFT);
168+
StackPane.setMargin(controlsVBox, new Insets(10, 0, 0, 10));
162169
} catch (Exception e) {
163170
// on any error, display the stack trace
164171
e.printStackTrace();

src/main/java/com/esri/samples/featurelayers/service_feature_table_manual_cache/ServiceFeatureTableManualCacheSample.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,12 @@
2828
import javafx.scene.control.Alert;
2929
import javafx.scene.control.Button;
3030
import javafx.scene.control.Label;
31+
import javafx.scene.layout.Background;
32+
import javafx.scene.layout.BackgroundFill;
33+
import javafx.scene.layout.CornerRadii;
3134
import javafx.scene.layout.StackPane;
3235
import javafx.scene.layout.VBox;
36+
import javafx.scene.paint.Paint;
3337
import javafx.stage.Stage;
3438

3539
import com.esri.arcgisruntime.concurrent.ListenableFuture;
@@ -72,9 +76,12 @@ public void start(Stage stage) {
7276
stage.show();
7377

7478
// create a control panel
75-
VBox vBoxControl = new VBox(6);
76-
vBoxControl.setMaxSize(200, 80);
77-
vBoxControl.getStyleClass().add("panel-region");
79+
VBox controlsVBox = new VBox(6);
80+
controlsVBox.setBackground(new Background(new BackgroundFill(Paint.valueOf("rgba(0,0,0,0.3)"), CornerRadii.EMPTY,
81+
Insets.EMPTY)));
82+
controlsVBox.setPadding(new Insets(10.0));
83+
controlsVBox.setMaxSize(200, 80);
84+
controlsVBox.getStyleClass().add("panel-region");
7885

7986
// create button to request the service table's cache
8087
Button requestCacheButton = new Button("Request Cache");
@@ -88,7 +95,7 @@ public void start(Stage stage) {
8895
featuresReturnLabel.getStyleClass().add("panel-label");
8996

9097
// add label and button to the control panel
91-
vBoxControl.getChildren().addAll(featuresReturnLabel, requestCacheButton);
98+
controlsVBox.getChildren().addAll(featuresReturnLabel, requestCacheButton);
9299

93100
// create service feature table from a url
94101
featureTable = new ServiceFeatureTable(SERVICE_FEATURE_URL);
@@ -123,9 +130,9 @@ public void start(Stage stage) {
123130
mapView.setViewpoint(new Viewpoint(new Point(-13630484, 4545415, SpatialReferences.getWebMercator()), 150000));
124131

125132
// add the map view and control panel to stack pane
126-
stackPane.getChildren().addAll(mapView, vBoxControl);
127-
StackPane.setAlignment(vBoxControl, Pos.TOP_LEFT);
128-
StackPane.setMargin(vBoxControl, new Insets(10, 0, 0, 10));
133+
stackPane.getChildren().addAll(mapView, controlsVBox);
134+
StackPane.setAlignment(controlsVBox, Pos.TOP_LEFT);
135+
StackPane.setMargin(controlsVBox, new Insets(10, 0, 0, 10));
129136
} catch (Exception e) {
130137
// on any error, display the stack trace
131138
e.printStackTrace();

src/main/java/com/esri/samples/geometry/geometry_engine_simplify/GeometryEngineSimplifySample.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@
2222
import javafx.scene.Scene;
2323
import javafx.scene.control.Alert;
2424
import javafx.scene.control.Button;
25+
import javafx.scene.layout.Background;
26+
import javafx.scene.layout.BackgroundFill;
27+
import javafx.scene.layout.CornerRadii;
2528
import javafx.scene.layout.StackPane;
2629
import javafx.scene.layout.VBox;
30+
import javafx.scene.paint.Paint;
2731
import javafx.stage.Stage;
2832

2933
import com.esri.arcgisruntime.geometry.Geometry;
@@ -69,9 +73,12 @@ public void start(Stage stage) {
6973
stage.show();
7074

7175
// create a control panel
72-
VBox vBoxControl = new VBox(6);
73-
vBoxControl.setMaxSize(110, 80);
74-
vBoxControl.getStyleClass().add("panel-region");
76+
VBox controlsVBox = new VBox(6);
77+
controlsVBox.setBackground(new Background(new BackgroundFill(Paint.valueOf("rgba(0,0,0,0.3)"), CornerRadii.EMPTY,
78+
Insets.EMPTY)));
79+
controlsVBox.setPadding(new Insets(10.0));
80+
controlsVBox.setMaxSize(110, 80);
81+
controlsVBox.getStyleClass().add("panel-region");
7582

7683
// create simplify button
7784
Button simplifyButton = new Button("Simplify");
@@ -102,7 +109,7 @@ public void start(Stage stage) {
102109
});
103110

104111
// add buttons to the control panel
105-
vBoxControl.getChildren().addAll(simplifyButton, resetButton);
112+
controlsVBox.getChildren().addAll(simplifyButton, resetButton);
106113

107114
ArcGISMap map = new ArcGISMap(Basemap.createLightGrayCanvas());
108115

@@ -135,9 +142,9 @@ public void start(Stage stage) {
135142
geomOverlay.getGraphics().add(polygon);
136143

137144
// add the map view and control panel to stack pane
138-
stackPane.getChildren().addAll(mapView, vBoxControl);
139-
StackPane.setAlignment(vBoxControl, Pos.TOP_LEFT);
140-
StackPane.setMargin(vBoxControl, new Insets(10, 0, 0, 10));
145+
stackPane.getChildren().addAll(mapView, controlsVBox);
146+
StackPane.setAlignment(controlsVBox, Pos.TOP_LEFT);
147+
StackPane.setMargin(controlsVBox, new Insets(10, 0, 0, 10));
141148

142149
} catch (Exception e) {
143150
// on any error, display the stack trace

0 commit comments

Comments
 (0)