77 System.out.println(
"--- setSublocationId Method ---");
79 if (locationWindow ==
null) {
80 System.out.println(
"LocationWindow not available yet");
86 locationWindow.setSublocationId(1);
87 System.out.println(
"Set sublocation ID to 1 (first floor)");
92 locationWindow.setSublocationId(2);
93 System.out.println(
"Set sublocation ID to 2 (second floor)");
98 locationWindow.setSublocationId(0);
99 System.out.println(
"Set sublocation ID to 0 (ground floor)");
103 List<Integer> sublocationIds = Arrays.asList(1, 2, 3, 0, 5);
104 for (Integer
id : sublocationIds) {
105 locationWindow.setSublocationId(
id);
106 System.out.println(
"Switched to sublocation ID: " +
id);
141 System.out.println(
"--- Sublocation Change Listener ---");
143 if (locationWindow ==
null) {
144 System.out.println(
"LocationWindow not available yet");
148 DemoSublocationChangeListener listener =
new DemoSublocationChangeListener();
151 locationWindow.addSublocationChangeListener(listener);
152 System.out.println(
"Added sublocation change listener");
155 locationWindow.setSublocationId(1);
156 locationWindow.setSublocationId(2);
159 locationWindow.removeSublocationChangeListener(listener);
160 System.out.println(
"Removed sublocation change listener");
190 System.out.println(
"--- UserLocationLayer ---");
192 if (userLocationLayer ==
null) {
193 System.out.println(
"UserLocationLayer not available yet");
198 userLocationLayer.setVisible(
true);
199 System.out.println(
"User location layer set visible");
203 boolean visible = userLocationLayer.isVisible();
204 System.out.println(
"User location layer is visible: " + visible);
208 ScreenPoint anchor =
new ScreenPoint(100.0f, 200.0f);
209 userLocationLayer.setAnchor(anchor);
210 System.out.println(
"Set user location anchor to: (" + anchor.getX() +
", " + anchor.getY() +
")");
214 boolean anchorEnabled = userLocationLayer.anchorEnabled();
215 System.out.println(
"Anchor enabled: " + anchorEnabled);
219 userLocationLayer.resetAnchor();
220 System.out.println(
"Anchor reset to default");
228 System.out.println(
"--- Coordinate Conversion Methods ---");
230 if (locationWindow ==
null) {
231 System.out.println(
"LocationWindow not available yet");
238 Point metersPoint = locationWindow.screenPositionToMeters(screenPoint);
239 System.out.printf(
"Screen position (%.1f, %.1f) converted to meters: (%.1f, %.1f)%n",
240 screenPoint.
getX(), screenPoint.
getY(), metersPoint.
getX(), metersPoint.
getY());
246 Point metersPoint2 = locationWindow.screenPositionToMeters(screenPoint2);
247 System.out.printf(
"Screen position (%.1f, %.1f) converted to meters: (%.1f, %.1f)%n",
248 screenPoint2.
getX(), screenPoint2.
getY(), metersPoint2.
getX(), metersPoint2.
getY());
254 Point screenPoint3 = locationWindow.metersToScreenPosition(metersPoint3,
true);
255 System.out.printf(
"Meters position (%.1f, %.1f) converted to screen with clipping: (%.1f, %.1f)%n",
256 metersPoint3.
getX(), metersPoint3.
getY(), screenPoint3.
getX(), screenPoint3.
getY());
262 Point screenPoint4 = locationWindow.metersToScreenPosition(metersPoint4,
false);
263 System.out.printf(
"Meters position (%.1f, %.1f) converted to screen without clipping: (%.1f, %.1f)%n",
264 metersPoint4.
getX(), metersPoint4.
getY(), screenPoint4.
getX(), screenPoint4.
getY());
268 List<Point> testScreenPoints = Arrays.asList(
270 new Point(250.0, 250.0),
271 new Point(1000.0, 600.0)
274 for (
int i = 0; i < testScreenPoints.size(); i++) {
275 Point screenPoint = testScreenPoints.get(i);
276 Point metersPoint = locationWindow.screenPositionToMeters(screenPoint);
277 Point backToScreen = locationWindow.metersToScreenPosition(metersPoint,
false);
278 System.out.printf(
"Test %d: Screen (%.1f, %.1f) -> Meters (%.1f, %.1f) -> Screen (%.1f, %.1f)%n",
279 i, screenPoint.
getX(), screenPoint.
getY(),
280 metersPoint.
getX(), metersPoint.
getY(),
281 backToScreen.
getX(), backToScreen.
getY());
289 System.out.println(
"--- Map Feature Selection Methods ---");
291 if (locationWindow ==
null) {
292 System.out.println(
"LocationWindow not available yet");
298 String featureId =
"room_101";
299 boolean selected = locationWindow.selectMapFeature(featureId);
300 System.out.println(
"Selected map feature " + featureId +
": " + selected);
305 String featureId2 =
"office_205";
306 boolean selected2 = locationWindow.selectMapFeature(featureId2);
307 System.out.println(
"Selected map feature " + featureId2 +
": " + selected2);
312 List<String> selectedFeatures = locationWindow.getSelectedMapFeatures();
313 System.out.println(
"Currently selected map features: " + selectedFeatures.size() +
" features");
314 for (String feature : selectedFeatures) {
315 System.out.println(
" - " + feature);
321 boolean deselected = locationWindow.deselectMapFeature(featureId);
322 System.out.println(
"Deselected map feature " + featureId +
": " + deselected);
327 boolean deselected2 = locationWindow.deselectMapFeature(featureId2);
328 System.out.println(
"Deselected map feature " + featureId2 +
": " + deselected2);
333 locationWindow.deselectAllMapFeatures();
334 System.out.println(
"Deselected all map features");
339 List<String> remainingFeatures = locationWindow.getSelectedMapFeatures();
340 System.out.println(
"Remaining selected features after deselect all: " + remainingFeatures.size() +
" features");
344 List<String> testFeatureIds = Arrays.asList(
"room_101",
"office_205",
"meeting_room_301",
"cafe_401");
347 for (String featureId : testFeatureIds) {
348 boolean success = locationWindow.selectMapFeature(featureId);
349 System.out.println(
"Selected feature " + featureId +
": " + success);
353 List<String> allSelected = locationWindow.getSelectedMapFeatures();
354 System.out.println(
"All selected features: " + allSelected.size() +
" features");
357 locationWindow.deselectAllMapFeatures();
358 System.out.println(
"Deselected all features at once");
394 System.out.println(
"--- Zoom Properties ---");
396 if (locationWindow ==
null) {
397 System.out.println(
"LocationWindow not available yet");
403 double currentZoom = locationWindow.getZoomFactor();
404 System.out.println(
"Current zoom factor: " + currentZoom);
409 locationWindow.setZoomFactor(150.0);
410 System.out.println(
"Set zoom factor to 150.0");
415 double minZoomFactor = locationWindow.getMinZoomFactor();
416 System.out.println(
"Minimum zoom factor: " + minZoomFactor);
421 locationWindow.setMinZoomFactor(50.0);
422 System.out.println(
"Set minimum zoom factor to 50.0");
427 double maxZoomFactor = locationWindow.getMaxZoomFactor();
428 System.out.println(
"Maximum zoom factor: " + maxZoomFactor);
433 locationWindow.setMaxZoomFactor(300.0);
434 System.out.println(
"Set maximum zoom factor to 300.0");
438 List<Double> testZoomFactors = Arrays.asList(100.0, 125.0, 150.0, 200.0, 250.0);
439 for (Double zoom : testZoomFactors) {
440 locationWindow.setZoomFactor(zoom);
441 System.out.println(
"Changed zoom factor to: " + locationWindow.getZoomFactor());
445 System.out.println(
"Testing zoom limits...");
446 locationWindow.setZoomFactor(locationWindow.getMinZoomFactor());
447 System.out.println(
"Set to minimum zoom: " + locationWindow.getZoomFactor());
449 locationWindow.setZoomFactor(locationWindow.getMaxZoomFactor());
450 System.out.println(
"Set to maximum zoom: " + locationWindow.getZoomFactor());
453 locationWindow.setZoomFactor(100.0);
454 System.out.println(
"Reset zoom factor to default: " + locationWindow.getZoomFactor());