123 System.out.println(
"--- setSublocationId Method ---");
125 if (locationWindow ==
null) {
126 System.out.println(
"LocationWindow not available yet");
132 locationWindow.setSublocationId(1);
133 System.out.println(
"Set sublocation ID to 1 (first floor)");
138 locationWindow.setSublocationId(2);
139 System.out.println(
"Set sublocation ID to 2 (second floor)");
144 locationWindow.setSublocationId(0);
145 System.out.println(
"Set sublocation ID to 0 (ground floor)");
149 List<Integer> sublocationIds = Arrays.asList(1, 2, 3, 0, 5);
150 for (Integer
id : sublocationIds) {
151 locationWindow.setSublocationId(
id);
152 System.out.println(
"Switched to sublocation ID: " +
id);
187 System.out.println(
"--- Sublocation Change Listener ---");
189 if (locationWindow ==
null) {
190 System.out.println(
"LocationWindow not available yet");
194 DemoSublocationChangeListener listener =
new DemoSublocationChangeListener();
197 locationWindow.addSublocationChangeListener(listener);
198 System.out.println(
"Added sublocation change listener");
201 locationWindow.setSublocationId(1);
202 locationWindow.setSublocationId(2);
205 locationWindow.removeSublocationChangeListener(listener);
206 System.out.println(
"Removed sublocation change listener");
214 System.out.println(
"--- UserLocationLayer ---");
216 if (userLocationLayer ==
null) {
217 System.out.println(
"UserLocationLayer not available yet");
222 userLocationLayer.setVisible(
true);
223 System.out.println(
"User location layer set visible");
227 boolean visible = userLocationLayer.isVisible();
228 System.out.println(
"User location layer is visible: " + visible);
232 ScreenPoint anchor =
new ScreenPoint(100.0f, 200.0f);
233 userLocationLayer.setAnchor(anchor);
234 System.out.println(
"Set user location anchor to: (" + anchor.getX() +
", " + anchor.getY() +
")");
238 boolean anchorEnabled = userLocationLayer.anchorEnabled();
239 System.out.println(
"Anchor enabled: " + anchorEnabled);
243 userLocationLayer.resetAnchor();
244 System.out.println(
"Anchor reset to default");
252 System.out.println(
"--- Coordinate Conversion Methods ---");
254 if (locationWindow ==
null) {
255 System.out.println(
"LocationWindow not available yet");
261 ScreenPoint screenPoint =
new ScreenPoint(100.0, 200.0);
262 GlobalPoint globalPoint = locationWindow.screenPositionToGlobal(screenPoint);
263 System.out.printf(
"Screen position (%.1f, %.1f) converted to WGS84: (%.6f, %.6f)%n",
270 ScreenPoint screenPoint2 = locationWindow.globalToScreenPosition(globalPoint2,
true);
271 System.out.printf(
"WGS84 (%.6f, %.6f) converted to screen with clipping: (%.1f, %.1f)%n",
275 List<ScreenPoint> testScreenPoints = Arrays.asList(
276 new ScreenPoint(0.0, 0.0),
277 new ScreenPoint(250.0, 250.0),
278 new ScreenPoint(1000.0, 600.0)
281 for (
int i = 0; i < testScreenPoints.size(); i++) {
282 ScreenPoint screen = testScreenPoints.get(i);
283 GlobalPoint global = locationWindow.screenPositionToGlobal(screen);
284 ScreenPoint backToScreen = locationWindow.globalToScreenPosition(global,
false);
285 System.out.printf(
"Test %d: Screen (%.1f, %.1f) -> WGS84 (%.6f, %.6f) -> Screen (%.1f, %.1f)%n",
286 i, screen.getX(), screen.getY(),
288 backToScreen.getX(), backToScreen.getY());
296 System.out.println(
"--- Map Feature Selection Methods ---");
298 if (locationWindow ==
null) {
299 System.out.println(
"LocationWindow not available yet");
305 String featureId =
"room_101";
306 boolean selected = locationWindow.selectMapFeature(featureId);
307 System.out.println(
"Selected map feature " + featureId +
": " + selected);
312 String featureId2 =
"office_205";
313 boolean selected2 = locationWindow.selectMapFeature(featureId2);
314 System.out.println(
"Selected map feature " + featureId2 +
": " + selected2);
319 List<String> selectedFeatures = locationWindow.getSelectedMapFeatures();
320 System.out.println(
"Currently selected map features: " + selectedFeatures.size() +
" features");
321 for (String feature : selectedFeatures) {
322 System.out.println(
" - " + feature);
328 boolean deselected = locationWindow.deselectMapFeature(featureId);
329 System.out.println(
"Deselected map feature " + featureId +
": " + deselected);
334 boolean deselected2 = locationWindow.deselectMapFeature(featureId2);
335 System.out.println(
"Deselected map feature " + featureId2 +
": " + deselected2);
340 locationWindow.deselectAllMapFeatures();
341 System.out.println(
"Deselected all map features");
346 List<String> remainingFeatures = locationWindow.getSelectedMapFeatures();
347 System.out.println(
"Remaining selected features after deselect all: " + remainingFeatures.size() +
" features");
351 List<String> testFeatureIds = Arrays.asList(
"room_101",
"office_205",
"meeting_room_301",
"cafe_401");
354 for (String featureId : testFeatureIds) {
355 boolean success = locationWindow.selectMapFeature(featureId);
356 System.out.println(
"Selected feature " + featureId +
": " + success);
360 List<String> allSelected = locationWindow.getSelectedMapFeatures();
361 System.out.println(
"All selected features: " + allSelected.size() +
" features");
364 locationWindow.deselectAllMapFeatures();
365 System.out.println(
"Deselected all features at once");
401 System.out.println(
"--- Zoom Properties ---");
403 if (locationWindow ==
null) {
404 System.out.println(
"LocationWindow not available yet");
410 double currentZoom = locationWindow.getZoomFactor();
411 System.out.println(
"Current zoom factor: " + currentZoom);
416 locationWindow.setZoomFactor(150.0);
417 System.out.println(
"Set zoom factor to 150.0");
422 double minZoomFactor = locationWindow.getMinZoomFactor();
423 System.out.println(
"Minimum zoom factor: " + minZoomFactor);
428 locationWindow.setMinZoomFactor(50.0);
429 System.out.println(
"Set minimum zoom factor to 50.0");
434 double maxZoomFactor = locationWindow.getMaxZoomFactor();
435 System.out.println(
"Maximum zoom factor: " + maxZoomFactor);
440 locationWindow.setMaxZoomFactor(300.0);
441 System.out.println(
"Set maximum zoom factor to 300.0");
445 List<Double> testZoomFactors = Arrays.asList(100.0, 125.0, 150.0, 200.0, 250.0);
446 for (Double zoom : testZoomFactors) {
447 locationWindow.setZoomFactor(zoom);
448 System.out.println(
"Changed zoom factor to: " + locationWindow.getZoomFactor());
452 System.out.println(
"Testing zoom limits...");
453 locationWindow.setZoomFactor(locationWindow.getMinZoomFactor());
454 System.out.println(
"Set to minimum zoom: " + locationWindow.getZoomFactor());
456 locationWindow.setZoomFactor(locationWindow.getMaxZoomFactor());
457 System.out.println(
"Set to maximum zoom: " + locationWindow.getZoomFactor());
460 locationWindow.setZoomFactor(100.0);
461 System.out.println(
"Reset zoom factor to default: " + locationWindow.getZoomFactor());