1 package fr.ifremer.dali.ui.swing.util.map;
2
3 /*-
4 * #%L
5 * Dali :: UI
6 * $Id:$
7 * $HeadURL:$
8 * %%
9 * Copyright (C) 2014 - 2017 Ifremer
10 * %%
11 * This program is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Affero General Public License as published by
13 * the Free Software Foundation, either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU Affero General Public License
22 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 * #L%
24 */
25
26 import fr.ifremer.dali.map.MapMode;
27 import fr.ifremer.dali.ui.swing.util.map.layer.DataLayerCollection;
28 import org.geotools.geometry.jts.ReferencedEnvelope;
29 import org.geotools.map.MapContent;
30 import org.opengis.referencing.crs.CoordinateReferenceSystem;
31
32 import java.awt.Color;
33 import java.util.List;
34
35 /**
36 * Map builder interface
37 * Initialise map content, behaviors, etc...
38 *
39 * @author peck7 on 02/06/2017.
40 */
41 public interface MapBuilder {
42
43 /**
44 * Generate a new MapContent with map layers
45 *
46 * @param preferredMode the preferred map mode
47 * @return the new map content
48 */
49 MapContent buildNewMapContent(MapMode preferredMode);
50
51 CoordinateReferenceSystem getTargetCRS();
52
53 MapMode getCurrentMapMode();
54
55 /**
56 * Build the data layer collection from a survey
57 *
58 * @param dataObject the source object
59 * @return the collection of data layers
60 */
61 DataLayerCollection buildDataLayerCollection(Object dataObject) throws Exception;
62
63 /**
64 * Retrieve the list of layer names that should be visible for the provided envelope
65 *
66 * @param envelope the envelope
67 * @return list of displayable layer names
68 */
69 List<String> getDisplayableLayerNames(ReferencedEnvelope envelope);
70
71 /**
72 * Check online connectivity
73 *
74 * @return true if online available
75 */
76 boolean checkOnlineReachable();
77
78 /**
79 * Get the background color
80 *
81 * @return the background color
82 */
83 Color getBackgroundColor();
84
85 }