|
30 | 30 | import javafx.scene.image.Image; |
31 | 31 | import javafx.scene.image.ImageView; |
32 | 32 | import javafx.scene.layout.*; |
| 33 | +import javafx.scene.paint.Paint; |
33 | 34 | import javafx.stage.Stage; |
34 | 35 |
|
35 | 36 | import com.esri.arcgisruntime.concurrent.ListenableFuture; |
@@ -61,8 +62,7 @@ public void start(Stage stage) { |
61 | 62 | // create stack pane and application scene |
62 | 63 | StackPane stackPane = new StackPane(); |
63 | 64 | Scene scene = new Scene(stackPane); |
64 | | - scene.getStylesheets().add(getClass().getResource("/display_utility_associations/style.css").toExternalForm()); |
65 | | - |
| 65 | + |
66 | 66 | // set title, size, and add scene to stage |
67 | 67 | stage.setTitle("Display Utility Associations Sample"); |
68 | 68 | stage.setWidth(800); |
@@ -136,13 +136,19 @@ else if (networkSource.getSourceType() == UtilityNetworkSource.Type.JUNCTION) { |
136 | 136 |
|
137 | 137 | // create a legend |
138 | 138 | GridPane gridPane = new GridPane(); |
139 | | - gridPane.getStyleClass().add("grid-pane"); |
140 | 139 | gridPane.getColumnConstraints().addAll(Arrays.asList(new ColumnConstraints(25), new ColumnConstraints(100))); |
141 | 140 | gridPane.add(attachmentImageView, 0, 0); |
142 | 141 | gridPane.add(attachmentLabel, 1, 0); |
143 | 142 | gridPane.add(connectivityImageView, 0, 1); |
144 | 143 | gridPane.add(connectivityLabel, 1, 1); |
145 | | - |
| 144 | + gridPane.setMaxWidth(100); |
| 145 | + gridPane.setMaxHeight(80); |
| 146 | + gridPane.setBackground(new Background(new BackgroundFill(Paint.valueOf("rgba(255,255,255,0.3)"), CornerRadii.EMPTY, |
| 147 | + Insets.EMPTY))); |
| 148 | + gridPane.setPadding(new Insets(10)); |
| 149 | + gridPane.setVgap(20); |
| 150 | + gridPane.setAlignment(Pos.CENTER); |
| 151 | + |
146 | 152 | // add the map view and legend to the stack pane |
147 | 153 | stackPane.getChildren().addAll(mapView, gridPane); |
148 | 154 | StackPane.setAlignment(gridPane, Pos.TOP_LEFT); |
|
0 commit comments