36 System.out.println(
"--- setSublocationId Method ---");
38 if (locationWindow ==
null) {
39 System.out.println(
"LocationWindow not available yet");
45 locationWindow.setSublocationId(1);
46 System.out.println(
"Set sublocation ID to 1 (first floor)");
51 locationWindow.setSublocationId(2);
52 System.out.println(
"Set sublocation ID to 2 (second floor)");
57 locationWindow.setSublocationId(0);
58 System.out.println(
"Set sublocation ID to 0 (ground floor)");
62 List<Integer> sublocationIds = Arrays.asList(1, 2, 3, 0, 5);
63 for (Integer
id : sublocationIds) {
64 locationWindow.setSublocationId(
id);
65 System.out.println(
"Switched to sublocation ID: " +
id);
73 System.out.println(
"--- Coordinate Conversion Methods ---");
75 if (locationWindow ==
null) {
76 System.out.println(
"LocationWindow not available yet");
82 Point screenPoint =
new Point(100.0, 200.0);
83 Point metersPoint = locationWindow.screenPositionToMeters(screenPoint);
84 System.out.printf(
"Screen position (%.1f, %.1f) converted to meters: (%.1f, %.1f)%n",
85 screenPoint.getX(), screenPoint.getY(), metersPoint.getX(), metersPoint.getY());
90 Point screenPoint2 =
new Point(500.0, 300.0);
91 Point metersPoint2 = locationWindow.screenPositionToMeters(screenPoint2);
92 System.out.printf(
"Screen position (%.1f, %.1f) converted to meters: (%.1f, %.1f)%n",
93 screenPoint2.getX(), screenPoint2.getY(), metersPoint2.getX(), metersPoint2.getY());
98 Point metersPoint3 =
new Point(50.0, 75.0);
99 Point screenPoint3 = locationWindow.metersToScreenPosition(metersPoint3,
true);
100 System.out.printf(
"Meters position (%.1f, %.1f) converted to screen with clipping: (%.1f, %.1f)%n",
101 metersPoint3.getX(), metersPoint3.getY(), screenPoint3.getX(), screenPoint3.getY());
106 Point metersPoint4 =
new Point(150.0, 200.0);
107 Point screenPoint4 = locationWindow.metersToScreenPosition(metersPoint4,
false);
108 System.out.printf(
"Meters position (%.1f, %.1f) converted to screen without clipping: (%.1f, %.1f)%n",
109 metersPoint4.getX(), metersPoint4.getY(), screenPoint4.getX(), screenPoint4.getY());
113 List<Point> testScreenPoints = Arrays.asList(
115 new Point(250.0, 250.0),
116 new Point(1000.0, 600.0)
119 for (
int i = 0; i < testScreenPoints.size(); i++) {
120 Point screenPoint = testScreenPoints.get(i);
121 Point metersPoint = locationWindow.screenPositionToMeters(screenPoint);
122 Point backToScreen = locationWindow.metersToScreenPosition(metersPoint,
false);
123 System.out.printf(
"Test %d: Screen (%.1f, %.1f) -> Meters (%.1f, %.1f) -> Screen (%.1f, %.1f)%n",
124 i, screenPoint.getX(), screenPoint.getY(),
125 metersPoint.getX(), metersPoint.getY(),
126 backToScreen.getX(), backToScreen.getY());
134 System.out.println(
"--- Map Feature Selection Methods ---");
136 if (locationWindow ==
null) {
137 System.out.println(
"LocationWindow not available yet");
143 String featureId =
"room_101";
144 boolean selected = locationWindow.selectMapFeature(featureId);
145 System.out.println(
"Selected map feature " + featureId +
": " + selected);
150 String featureId2 =
"office_205";
151 boolean selected2 = locationWindow.selectMapFeature(featureId2);
152 System.out.println(
"Selected map feature " + featureId2 +
": " + selected2);
157 List<String> selectedFeatures = locationWindow.getSelectedMapFeatures();
158 System.out.println(
"Currently selected map features: " + selectedFeatures.size() +
" features");
159 for (String feature : selectedFeatures) {
160 System.out.println(
" - " + feature);
166 boolean deselected = locationWindow.deselectMapFeature(featureId);
167 System.out.println(
"Deselected map feature " + featureId +
": " + deselected);
172 boolean deselected2 = locationWindow.deselectMapFeature(featureId2);
173 System.out.println(
"Deselected map feature " + featureId2 +
": " + deselected2);
178 locationWindow.deselectAllMapFeatures();
179 System.out.println(
"Deselected all map features");
184 List<String> remainingFeatures = locationWindow.getSelectedMapFeatures();
185 System.out.println(
"Remaining selected features after deselect all: " + remainingFeatures.size() +
" features");
189 List<String> testFeatureIds = Arrays.asList(
"room_101",
"office_205",
"meeting_room_301",
"cafe_401");
192 for (String featureId : testFeatureIds) {
193 boolean success = locationWindow.selectMapFeature(featureId);
194 System.out.println(
"Selected feature " + featureId +
": " + success);
198 List<String> allSelected = locationWindow.getSelectedMapFeatures();
199 System.out.println(
"All selected features: " + allSelected.size() +
" features");
202 locationWindow.deselectAllMapFeatures();
203 System.out.println(
"Deselected all features at once");
210 System.out.println(
"--- Zoom Properties ---");
212 if (locationWindow ==
null) {
213 System.out.println(
"LocationWindow not available yet");
219 double currentZoom = locationWindow.getZoomFactor();
220 System.out.println(
"Current zoom factor: " + currentZoom);
225 locationWindow.setZoomFactor(150.0);
226 System.out.println(
"Set zoom factor to 150.0");
231 double minZoomFactor = locationWindow.getMinZoomFactor();
232 System.out.println(
"Minimum zoom factor: " + minZoomFactor);
237 locationWindow.setMinZoomFactor(50.0);
238 System.out.println(
"Set minimum zoom factor to 50.0");
243 double maxZoomFactor = locationWindow.getMaxZoomFactor();
244 System.out.println(
"Maximum zoom factor: " + maxZoomFactor);
249 locationWindow.setMaxZoomFactor(300.0);
250 System.out.println(
"Set maximum zoom factor to 300.0");
254 List<Double> testZoomFactors = Arrays.asList(100.0, 125.0, 150.0, 200.0, 250.0);
255 for (Double zoom : testZoomFactors) {
256 locationWindow.setZoomFactor(zoom);
257 System.out.println(
"Changed zoom factor to: " + locationWindow.getZoomFactor());
261 System.out.println(
"Testing zoom limits...");
262 locationWindow.setZoomFactor(locationWindow.getMinZoomFactor());
263 System.out.println(
"Set to minimum zoom: " + locationWindow.getZoomFactor());
265 locationWindow.setZoomFactor(locationWindow.getMaxZoomFactor());
266 System.out.println(
"Set to maximum zoom: " + locationWindow.getZoomFactor());
269 locationWindow.setZoomFactor(100.0);
270 System.out.println(
"Reset zoom factor to default: " + locationWindow.getZoomFactor());