Skip to content

Package: MapViewerPresentation$Bindings

MapViewerPresentation$Bindings

Coverage

1: /*
2: * *************************************************************************************************************************************************************
3: *
4: * blueMarine III: Semantic DAM
5: * http://tidalwave.it/projects/bluemarine3
6: *
7: * Copyright (C) 2024 - 2025 by Tidalwave s.a.s. (http://tidalwave.it)
8: *
9: * *************************************************************************************************************************************************************
10: *
11: * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
12: * You may obtain a copy of the License at
13: *
14: * http://www.apache.org/licenses/LICENSE-2.0
15: *
16: * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
17: * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
18: *
19: * *************************************************************************************************************************************************************
20: *
21: * git clone https://bitbucket.org/tidalwave/bluemarine3-src
22: * git clone https://github.com/tidalwave-it/bluemarine3-src
23: *
24: * *************************************************************************************************************************************************************
25: */
26:
27: package it.tidalwave.bluemarine3.mapviewer.spi;
28:
29: import jakarta.annotation.Nonnull;
30: import java.nio.file.Path;
31: import it.tidalwave.geo.Coordinates;
32: import it.tidalwave.geo.GeoTrack;
33: import it.tidalwave.geo.RectangularArea;
34: import it.tidalwave.ui.core.BoundProperty;
35: import it.tidalwave.ui.core.UserNotification;
36: import it.tidalwave.ui.core.role.UserAction;
37: import lombok.Builder;
38:
39: /***************************************************************************************************************************************************************
40: *
41: * @stereotype Presentation
42: * @author Fabrizio Giudici
43: *
44: **************************************************************************************************************************************************************/
45: public interface MapViewerPresentation
46: {
47: @Builder
48: public static class Bindings
49: {
50: @Nonnull
51: public final UserAction zoomIn;
52: @Nonnull
53: public final UserAction zoomOut;
54: @Nonnull
55: public final UserAction reframe;
56: @Nonnull
57: public final BoundProperty<Double> zoom;
58: @Nonnull
59: public final BoundProperty<Coordinates> coordinatesUnderMouse;
60: }
61:
62: /***********************************************************************************************************************************************************
63: * Initialise the interface.
64: * @param bindings the bindings
65: * @param tileCacheFolder the folder to use as a tile cache
66: **********************************************************************************************************************************************************/
67: public void initialize (@Nonnull Bindings bindings, @Nonnull Path tileCacheFolder);
68:
69: /***********************************************************************************************************************************************************
70: * Renders the map at the given point, with the given zoom level.
71: * @param center the center coordinates
72: * @param zoom the zoom level
73: **********************************************************************************************************************************************************/
74: public void renderMapAt (@Nonnull Coordinates center, int zoom);
75:
76: /***********************************************************************************************************************************************************
77: * Renders a track on the map.
78: * @param track the track to render
79: * @param area the area to fit to
80: **********************************************************************************************************************************************************/
81: // TODO: should be a PresentationModel
82: public void renderTrack (@Nonnull GeoTrack track, @Nonnull RectangularArea area);
83:
84: /***********************************************************************************************************************************************************
85: * Removes the track from the map.
86: **********************************************************************************************************************************************************/
87: public void removeTrack();
88:
89: /***********************************************************************************************************************************************************
90: * Renders the given coordinates.
91: * @param coordinates the coordinates
92: **********************************************************************************************************************************************************/
93: public void renderCoordinates (@Nonnull String coordinates);
94:
95: /***********************************************************************************************************************************************************
96: * Fits the map to the given area.
97: * @param area the area to fit to
98: **********************************************************************************************************************************************************/
99: public void fitTo (@Nonnull RectangularArea area);
100:
101: /***********************************************************************************************************************************************************
102: * Shows a waiting symbol.
103: **********************************************************************************************************************************************************/
104: public void showWaiting();
105:
106: /***********************************************************************************************************************************************************
107: * Hides the waiting symbol.
108: **********************************************************************************************************************************************************/
109: public void hideWaiting();
110:
111: /***********************************************************************************************************************************************************
112: * Notifies an error.
113: * @param notification the error notification
114: **********************************************************************************************************************************************************/
115: public void notifyError (@Nonnull UserNotification notification);
116: }