75 System.out.println(
"--- setSublocationId Method ---");
77 if (locationWindow ==
null) {
78 System.out.println(
"LocationWindow not available yet");
84 locationWindow.setSublocationId(1);
85 System.out.println(
"Set sublocation ID to 1 (first floor)");
90 locationWindow.setSublocationId(2);
91 System.out.println(
"Set sublocation ID to 2 (second floor)");
96 locationWindow.setSublocationId(0);
97 System.out.println(
"Set sublocation ID to 0 (ground floor)");
101 List<Integer> sublocationIds = Arrays.asList(1, 2, 3, 0, 5);
102 for (Integer
id : sublocationIds) {
103 locationWindow.setSublocationId(
id);
104 System.out.println(
"Switched to sublocation ID: " +
id);
139 System.out.println(
"--- Sublocation Change Listener ---");
141 if (locationWindow ==
null) {
142 System.out.println(
"LocationWindow not available yet");
146 DemoSublocationChangeListener listener =
new DemoSublocationChangeListener();
149 locationWindow.addSublocationChangeListener(listener);
150 System.out.println(
"Added sublocation change listener");
153 locationWindow.setSublocationId(1);
154 locationWindow.setSublocationId(2);
157 locationWindow.removeSublocationChangeListener(listener);
158 System.out.println(
"Removed sublocation change listener");
166 System.out.println(
"--- UserLocationLayer ---");
168 if (userLocationLayer ==
null) {
169 System.out.println(
"UserLocationLayer not available yet");
174 userLocationLayer.setVisible(
true);
175 System.out.println(
"User location layer set visible");
179 boolean visible = userLocationLayer.isVisible();
180 System.out.println(
"User location layer is visible: " + visible);
184 ScreenPoint anchor =
new ScreenPoint(100.0f, 200.0f);
185 userLocationLayer.setAnchor(anchor);
186 System.out.println(
"Set user location anchor to: (" + anchor.getX() +
", " + anchor.getY() +
")");
190 boolean anchorEnabled = userLocationLayer.anchorEnabled();
191 System.out.println(
"Anchor enabled: " + anchorEnabled);
195 userLocationLayer.resetAnchor();
196 System.out.println(
"Anchor reset to default");
204 System.out.println(
"--- Coordinate Conversion Methods ---");
206 if (locationWindow ==
null) {
207 System.out.println(
"LocationWindow not available yet");
214 Point metersPoint = locationWindow.screenPositionToMeters(screenPoint);
215 System.out.printf(
"Screen position (%.1f, %.1f) converted to meters: (%.1f, %.1f)%n",
216 screenPoint.
getX(), screenPoint.
getY(), metersPoint.
getX(), metersPoint.
getY());
222 Point metersPoint2 = locationWindow.screenPositionToMeters(screenPoint2);
223 System.out.printf(
"Screen position (%.1f, %.1f) converted to meters: (%.1f, %.1f)%n",
224 screenPoint2.
getX(), screenPoint2.
getY(), metersPoint2.
getX(), metersPoint2.
getY());
230 Point screenPoint3 = locationWindow.metersToScreenPosition(metersPoint3,
true);
231 System.out.printf(
"Meters position (%.1f, %.1f) converted to screen with clipping: (%.1f, %.1f)%n",
232 metersPoint3.
getX(), metersPoint3.
getY(), screenPoint3.
getX(), screenPoint3.
getY());
238 Point screenPoint4 = locationWindow.metersToScreenPosition(metersPoint4,
false);
239 System.out.printf(
"Meters position (%.1f, %.1f) converted to screen without clipping: (%.1f, %.1f)%n",
240 metersPoint4.
getX(), metersPoint4.
getY(), screenPoint4.
getX(), screenPoint4.
getY());
244 List<Point> testScreenPoints = Arrays.asList(
246 new Point(250.0, 250.0),
247 new Point(1000.0, 600.0)
250 for (
int i = 0; i < testScreenPoints.size(); i++) {
251 Point screenPoint = testScreenPoints.get(i);
252 Point metersPoint = locationWindow.screenPositionToMeters(screenPoint);
253 Point backToScreen = locationWindow.metersToScreenPosition(metersPoint,
false);
254 System.out.printf(
"Test %d: Screen (%.1f, %.1f) -> Meters (%.1f, %.1f) -> Screen (%.1f, %.1f)%n",
255 i, screenPoint.
getX(), screenPoint.
getY(),
256 metersPoint.
getX(), metersPoint.
getY(),
257 backToScreen.
getX(), backToScreen.
getY());
265 System.out.println(
"--- Map Feature Selection Methods ---");
267 if (locationWindow ==
null) {
268 System.out.println(
"LocationWindow not available yet");
274 String featureId =
"room_101";
275 boolean selected = locationWindow.selectMapFeature(featureId);
276 System.out.println(
"Selected map feature " + featureId +
": " + selected);
281 String featureId2 =
"office_205";
282 boolean selected2 = locationWindow.selectMapFeature(featureId2);
283 System.out.println(
"Selected map feature " + featureId2 +
": " + selected2);
288 List<String> selectedFeatures = locationWindow.getSelectedMapFeatures();
289 System.out.println(
"Currently selected map features: " + selectedFeatures.size() +
" features");
290 for (String feature : selectedFeatures) {
291 System.out.println(
" - " + feature);
297 boolean deselected = locationWindow.deselectMapFeature(featureId);
298 System.out.println(
"Deselected map feature " + featureId +
": " + deselected);
303 boolean deselected2 = locationWindow.deselectMapFeature(featureId2);
304 System.out.println(
"Deselected map feature " + featureId2 +
": " + deselected2);
309 locationWindow.deselectAllMapFeatures();
310 System.out.println(
"Deselected all map features");
315 List<String> remainingFeatures = locationWindow.getSelectedMapFeatures();
316 System.out.println(
"Remaining selected features after deselect all: " + remainingFeatures.size() +
" features");
320 List<String> testFeatureIds = Arrays.asList(
"room_101",
"office_205",
"meeting_room_301",
"cafe_401");
323 for (String featureId : testFeatureIds) {
324 boolean success = locationWindow.selectMapFeature(featureId);
325 System.out.println(
"Selected feature " + featureId +
": " + success);
329 List<String> allSelected = locationWindow.getSelectedMapFeatures();
330 System.out.println(
"All selected features: " + allSelected.size() +
" features");
333 locationWindow.deselectAllMapFeatures();
334 System.out.println(
"Deselected all features at once");
370 System.out.println(
"--- Zoom Properties ---");
372 if (locationWindow ==
null) {
373 System.out.println(
"LocationWindow not available yet");
379 double currentZoom = locationWindow.getZoomFactor();
380 System.out.println(
"Current zoom factor: " + currentZoom);
385 locationWindow.setZoomFactor(150.0);
386 System.out.println(
"Set zoom factor to 150.0");
391 double minZoomFactor = locationWindow.getMinZoomFactor();
392 System.out.println(
"Minimum zoom factor: " + minZoomFactor);
397 locationWindow.setMinZoomFactor(50.0);
398 System.out.println(
"Set minimum zoom factor to 50.0");
403 double maxZoomFactor = locationWindow.getMaxZoomFactor();
404 System.out.println(
"Maximum zoom factor: " + maxZoomFactor);
409 locationWindow.setMaxZoomFactor(300.0);
410 System.out.println(
"Set maximum zoom factor to 300.0");
414 List<Double> testZoomFactors = Arrays.asList(100.0, 125.0, 150.0, 200.0, 250.0);
415 for (Double zoom : testZoomFactors) {
416 locationWindow.setZoomFactor(zoom);
417 System.out.println(
"Changed zoom factor to: " + locationWindow.getZoomFactor());
421 System.out.println(
"Testing zoom limits...");
422 locationWindow.setZoomFactor(locationWindow.getMinZoomFactor());
423 System.out.println(
"Set to minimum zoom: " + locationWindow.getZoomFactor());
425 locationWindow.setZoomFactor(locationWindow.getMaxZoomFactor());
426 System.out.println(
"Set to maximum zoom: " + locationWindow.getZoomFactor());
429 locationWindow.setZoomFactor(100.0);
430 System.out.println(
"Reset zoom factor to default: " + locationWindow.getZoomFactor());