001/*
002 * This file is part of McIDAS-V
003 *
004 * Copyright 2007-2025
005 * Space Science and Engineering Center (SSEC)
006 * University of Wisconsin - Madison
007 * 1225 W. Dayton Street, Madison, WI 53706, USA
008 * https://www.ssec.wisc.edu/mcidas/
009 * 
010 * All Rights Reserved
011 * 
012 * McIDAS-V is built on Unidata's IDV and SSEC's VisAD libraries, and
013 * some McIDAS-V source code is based on IDV and VisAD source code.  
014 * 
015 * McIDAS-V is free software; you can redistribute it and/or modify
016 * it under the terms of the GNU Lesser Public License as published by
017 * the Free Software Foundation; either version 3 of the License, or
018 * (at your option) any later version.
019 * 
020 * McIDAS-V is distributed in the hope that it will be useful,
021 * but WITHOUT ANY WARRANTY; without even the implied warranty of
022 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
023 * GNU Lesser Public License for more details.
024 * 
025 * You should have received a copy of the GNU Lesser Public License
026 * along with this program.  If not, see https://www.gnu.org/licenses/.
027 */
028
029package edu.wisc.ssec.mcidasv;
030
031import java.awt.Color;
032import java.awt.Dimension;
033
034import ucar.unidata.idv.IdvConstants;
035import ucar.unidata.util.PatternFileFilter;
036
037/**
038 * Application wide constants.
039 */
040public interface Constants extends IdvConstants {
041
042    /** Path to a skin that creates a window with an empty comp group. */
043    String BLANK_COMP_GROUP =
044        "/edu/wisc/ssec/mcidasv/resources/skins/window/comptest.xml";
045
046    /** Name of a thing that contains the data choosers and field selector. */
047    String DATASELECTOR_NAME = "McIDAS-V - Data Explorer";
048
049    /**
050     * A thing that contains one or more of the things named
051     * {@code PANEL_NAME}. One of these can be either in a tab
052     * or in it's own window.
053     */
054    String DISPLAY_NAME = "Display";
055
056    /** Name of a thing that contains the display/layer controls. */
057    String DISPLAYCONTROLLER_NAME = "Display Controller";
058
059    /** Macro for the build date. */
060    String MACRO_BUILDDATE = "%BUILDDATE%";
061
062    /** Macro for the copyright year in the about HTML file. */
063    String MACRO_COPYRIGHT_YEAR = "%COPYRIGHT_YEAR%";
064
065    /** Macro for the IDV version in the about HTML file. */
066    String MACRO_IDV_VERSION = "%IDVVERSION%";
067
068    /** Macro for the version in the about HTML file. */
069    String MACRO_VERSION = "%MCVERSION%";
070
071    /** Macro for the VisAD version in the about HTML file. */
072    String MACRO_VISAD_VERSION = "%VISADVERSION%";
073
074    /** Macro for granule count (only applies for swath data). */
075    String MACRO_GRANULE_COUNT = "%granulecount%";
076
077    /** Default size for GUI elements. */
078    int ELEMENT_WIDTH = 90;
079    int GAP_RELATED = 6;
080    int GAP_UNRELATED = (GAP_RELATED * 2);
081    int ELEMENT_DOUBLE_WIDTH = ELEMENT_WIDTH * 2;
082    int ELEMENT_ONEHALF_WIDTH = (int)Math.round(ELEMENT_WIDTH * 1.5);
083    int ELEMENT_HALF_WIDTH = Math.round(ELEMENT_WIDTH / 2);
084    int ELEMENT_DOUBLEDOUBLE_WIDTH = (ELEMENT_DOUBLE_WIDTH * 2) + ELEMENT_WIDTH + (GAP_RELATED * 3) + 24;
085    
086    /**
087     * Common line styles used in various UI controls
088     */
089    
090    String [] lineStyles = new String[] { "_____", "_ _ _", ".....", "_._._" };
091
092    /** Icon locations for buttons. */
093    String ICON_APPLY_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/action_go.gif";
094    String ICON_ACCEPT_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/accept.png";
095    String ICON_CANCEL_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/stop-loads16.png";
096    String ICON_EXCLAMATION_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/exclamation.png";
097    String ICON_INFORMATION_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/information.png";
098    String ICON_ERROR_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/error.png";
099    String ICON_HELP_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/show-help16.png";
100    String ICON_ADD_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/add.png";
101    String ICON_DELETE_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/delete.png";
102    String ICON_CONNECT_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/connect.png";
103    String ICON_DISCONNECT_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/disconnect.png";
104    String ICON_UNDO_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/arrow_undo.png";
105    String ICON_REDO_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/arrow_redo.png";
106    String ICON_REFRESH_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/view-refresh16.png";
107    String ICON_OPEN_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/document-open16.png";
108    String ICON_SAVE_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/save-as-fave-bundle16.png";
109    String ICON_SAVEAS_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/document-save16.png";
110    String ICON_PREFERENCES_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/preferences-system16.png";
111    String ICON_NEWWINDOW_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/application_add.png";
112    String ICON_NEWTAB_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/tab_add.png";
113    String ICON_NEXT_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/resultset_next.png";
114    String ICON_PREVIOUS_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/resultset_previous.png";
115    String ICON_RANDOM_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/view-refresh16.png";
116    String ICON_HELPTIPS_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/dialog-information16.png";
117    String ICON_CONSOLE_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/utilities-system-monitor16.png";
118    String ICON_CHECKVERSION_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/preferences-desktop-multimedia16.png";
119    String ICON_FORUMS_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/report_go.png";
120    String ICON_SUPPORT_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/email_go.png";
121    String ICON_DATAEXPLORER_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/mcidasv-round16.png";
122    String ICON_LOCALDATA_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/show-data16.png";
123    String ICON_COLORTABLE_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/x-office-presentation16.png";
124    String ICON_LAYOUTEDIT_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/accessories-text-editor16.png";
125    String ICON_RANGEANDBEARING_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/network-wireless16.png";
126    String ICON_LOCATION_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/start-here16.png";
127    String ICON_BACKGROUND_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/background-image16.png";
128    String ICON_USERSGUIDE_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/book_open.png";
129    String ICON_GETTINGSTARTED_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/book_next.png";
130    String ICON_NOTE_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/note.png";
131    String ICON_MCIDASV_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/mcidasv-round16.png";
132    String ICON_MCIDASV_DEFAULT = "/edu/wisc/ssec/mcidasv/resources/icons/prefs/mcidasv-default-logo.png";
133    
134    String ICON_DEFAULTLAYOUT_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/key.png";
135    String ICON_DEFAULTLAYOUTADD_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/key_add.png";
136    String ICON_DEFAULTLAYOUTDELETE_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/key_delete.png";
137    
138    String ICON_REMOVE_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/edit-cut16.png";
139    String ICON_REMOVELAYERS_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/remove-layers16.png";
140    String ICON_REMOVEDATA_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/remove-data16.png";
141    String ICON_REMOVELAYERSDATA_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/remove-layers-data16.png";
142    
143    String ICON_FAVORITE_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/fave-bundle16.png";
144    String ICON_FAVORITESAVE_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/save-as-fave-bundle16.png";
145    String ICON_FAVORITEMANAGE_SMALL = "/edu/wisc/ssec/mcidasv/resources/icons/buttons/manage-favorite16.png";
146
147    String ICON_CANCEL = "/edu/wisc/ssec/mcidasv/resources/icons/toolbar/stop-load22.png";
148    String ICON_HELP = "/edu/wisc/ssec/mcidasv/resources/icons/toolbar/show-help22.png";
149    String ICON_REFRESH = "/edu/wisc/ssec/mcidasv/resources/icons/toolbar/view-refresh22.png";
150    String ICON_UPDATE = "/edu/wisc/ssec/mcidasv/resources/icons/toolbar/system-software-update22.png";
151    String ICON_OPEN = "/edu/wisc/ssec/mcidasv/resources/icons/toolbar/document-open22.png";
152    String ICON_SAVE = "/edu/wisc/ssec/mcidasv/resources/icons/toolbar/document-save22.png";
153    
154    /**
155     * Java OS descriptor for the Max OSX operating system. This should be
156     * constant for any machine running java on OSX.
157     */
158    String OS_OSX = "Mac OS X";
159
160    /**
161     * Name of thing that contains the actual VisAD display, the animation
162     * control, view and projection menus, and the toolbar.
163     */
164    String PANEL_NAME = "Panel";
165
166    /** For the "do not show again" option when dialog is shown warning users of this state */
167    String PREF_RELATIVE_TIME_BUNDLE = "Bundle contains relative time ADDE requests";
168
169    /** Server preference manager. */
170    String PREF_LIST_ADDE_SERVERS = "ADDE Servers";
171
172    /** Server state preference ID prefix. Holds the last server/group used. */
173    String PREF_SERVERSTATE = "idv.chooser.adde.serverstate";
174
175    /**
176     * The server/group to use if there is no value associated with
177     * {@link #PREF_SERVERSTATE}.
178     */
179    String[] DEFAULT_SERVERSTATE = new String[] { "adde.ucar.edu", "RTIMAGES" };
180
181    /** Advanced preferences for IDV, Java, and McIDAS-X. */
182    String PREF_LIST_ADVANCED = "Advanced";
183
184    /** Advanced preferences for IDV, Java, and McIDAS-X. */
185    String PREF_LIST_LOCAL_ADDE = "Local Data";
186
187    /** Preferences for which display types to allow. */
188    String PREF_LIST_AVAILABLE_DISPLAYS = "Available Displays";
189
190    /** Preferences for which data choosers should show up. */
191    String PREF_LIST_DATA_CHOOSERS = "Data Sources";
192
193    /** Name of panel containing preferences related to data formatting. */
194    String PREF_LIST_FORMATS_DATA = "Formats & Data";
195
196    /** Name of panel that holds the "general" sorts of user preferences. */
197    String PREF_LIST_GENERAL = "General";
198
199    /** Panel name for the different nav control scheme preferences. */
200    String PREF_LIST_NAV_CONTROLS = "Navigation Controls";
201
202    /** Pref for image chooser to include system servers. */
203    String PREF_SYSTEMSERVERSIMG =
204        "mcidasv.chooser.adde.image.servers.system";
205
206    /** Preferences for configuring what appears in the toolbar. */
207    String PREF_LIST_TOOLBAR = "Toolbar Options";
208
209    /** Name of different preferences for configuring how tabs/windows look. */
210    String PREF_LIST_VIEW = "Display Window";
211
212    /** Preference ID for limiting # of new windows when loading bundles. */
213    String PREF_OPEN_LIMIT_WIN = "mcv.open.limitwin";
214
215    /** Name of the version check user preference. */
216    String PREF_VERSION_CHECK = "mcidasv.doversioncheck";
217
218    /** Name of the pre-release check user preference. */
219    String PREF_PRERELEASE_CHECK = "mcidasv.doprereleasecheck";
220
221    /** Name of the {@literal "remove all data warning"} preference. */
222    String PREF_CONFIRM_REMOVE_DATA =
223        "mcv.warn.remove.data.all";
224
225    /** Name of the {@literal "remove all layers warning"} preference. */
226    String PREF_CONFIRM_REMOVE_LAYERS =
227        "mcv.warn.remove.layers.all";
228
229    /** Name of the {@literal "remove everything warning"} preference. */
230    String PREF_CONFIRM_REMOVE_BOTH =
231        "mcv.warn.remove.everything";
232
233    /**
234     * Preference for controlling the automated saving of the default layout.
235     */
236    String PREF_AUTO_SAVE_DEFAULT_LAYOUT = "mcidasv.defaultlayout.autosave";
237
238    String PREF_SAVE_DASHBOARD_VIZ = "mcidasv.dashboard.savevisibility";
239
240    /** Preference for saving image preview default. */
241    String PREF_IMAGE_PREVIEW = "mcidasv.chooser.adde.preview";
242    
243    /** Used to alert user they are modifying default color table */
244    String PREF_MODIFY_DEFAULT_COLOR_TABLE = "mcidasv.default.colortable.modify";
245
246    /** Whether or not to show the McIDAS-V {@literal "system"} bundles. */
247    String PREF_SHOW_SYSTEM_BUNDLES = "mcidasv.showsystembundles";
248
249    String PREF_NUM_IMAGE_PRESET_IMGCHOOSER = "mcidasv.numentries.imgchooser";
250
251    String PREF_NUM_IMAGE_PRESET_RADARCHOOSER = "mcidasv.numentries.rdrchooser";
252
253
254    /**
255     * Show large or small icons. If PREF_TBM_ICONS is disabled, this pref
256     * has no meaning.
257     */
258    String PREF_TBM_SIZE = "tbm.icon.size";
259
260    /** Property name for for the path to about dialog template. */
261    String PROP_ABOUTTEXT = "mcidasv.about.text";
262
263    /** Path to the main McIDAS-V icon. */
264    String PROP_APP_ICON = "mcidasv.window.icon";
265
266    /** When was visad.jar built? */
267    String PROP_VISAD_DATE = "visad.build.date";
268
269    /** What version of VisAD lives within visad.jar? */
270    String PROP_VISAD_REVISION = "visad.build.revision";
271
272    /** Was there a problem determing VisAD's version? */
273    String PROP_VISAD_PARSE_FAIL = "visad.build.parsefail";
274
275    /** What exactly broke the version extraction? */
276    String PROP_VISAD_ORIGINAL = "visad.build.contents";
277
278    /** When was McIDAS-V built? */
279    String PROP_BUILD_DATE = "mcidasv.build.date";
280
281    /** Property name for the copyright year. */
282    String PROP_COPYRIGHT_YEAR = "mcidasv.copyright.year";
283
284    /** Property name for the McIDAS-V homepage URL. */
285    String PROP_HOMEPAGE = "mcidasv.homepage";
286
287    /** Specifies use of {@code edu.wisc.ssec.mcidasv.ui.TabbedUIManager}. */
288    String PROP_TABBED_UI = "mcidasv.tabbedDisplay";
289
290    /** Property name for the major version number. */
291    String PROP_VERSION_MAJOR = "mcidasv.version.major";
292
293    /** Property name for the minor version number. */
294    String PROP_VERSION_MINOR = "mcidasv.version.minor";
295
296    /** Property name for the version release number. */
297    String PROP_VERSION_RELEASE = "mcidasv.version.release";
298
299    /** Property name for the path to version file. */
300    String PROP_VERSIONFILE = "mcidasv.version.file";
301
302    /** Property that determines whether the view panel should pop up. */
303    String PROP_VP_SHOWPOPUP =
304        "idv.ui.viewpanel.showpopup";
305
306    /** Property for whether view panel categories will be shown. */
307    String PROP_VP_SHOWCATS =
308        "idv.ui.viewpanel.showcategories";
309
310    /** Typo was found in IDV code. */
311    String PROP_VP_CATOPEN = "viewpanel.catgegory.open";
312
313    /**
314     * Property used to restore the size and position of the dashboard upon
315     * start.
316     */
317    String PROP_DASHBOARD_BOUNDS = "mcidasv.dashboard.bounds";
318
319    /** Property used to store and retrieve color selection history. */
320    String PROP_RECENT_COLORS = "mcidasv.colorchooser.recentcolors";
321
322    /**
323     * Property used to store and retrieve the {@literal "0-360"} checkbox
324     * value.
325     */
326    String PROP_HYDRA_360 = "mcidasv.hydra.multispectral.use360";
327    
328    /**
329     * Property indicating how many source granules made up a swath data
330     * source.
331     */
332    String PROP_GRANULE_COUNT = "mcidasv.swath.granulecount";
333
334    /** Application property file name. */
335    String PROPERTIES_FILE =
336        "/edu/wisc/ssec/mcidasv/resources/mcidasv.properties";
337
338    /** McIDAS-V base URL. */
339    String HOMEPAGE_URL = "https://www.ssec.wisc.edu/mcidas/software/v";
340
341    /** Location of latest version file under base URL. */
342    String VERSION_URL = "stable/version.txt";
343    String VERSION_HANDLER_URL = "stable/version.php";
344
345    /** Location of latest pre-release directory under base URL. */
346    String PRERELEASE_URL = "prerelease/";
347
348    /** Location of latest notice file under base URL. */
349    String NOTICE_URL = "stable/notice.txt";
350
351    /**
352     * {@literal "Scrub strings"} are simple string substitutions for things
353     * like labels.
354     */
355    String SCRUB_STRINGS_FILE =
356        "/edu/wisc/ssec/mcidasv/resources/scrubstrings.xml";
357
358    /** Where to look for javahelp. */
359    String DEFAULT_DOCPATH = "/docs/userguide";
360        
361    /** File suffix for bundle files. */
362    String SUFFIX_MCV = ".mcv";
363
364    /** File suffix for compressed bundle files. */
365    String SUFFIX_MCVZ = ".mcvz";
366
367    /** File filter used for bundle files. */
368    PatternFileFilter FILTER_MCV =
369        new PatternFileFilter("(.+\\.mcv$)",
370            "McIDAS-V Bundles (*.mcv)", SUFFIX_MCV);
371    
372    /** File filter used for bundle files. */
373    PatternFileFilter FILTER_MCVZ =
374        new PatternFileFilter("(.+\\.mcvz$)", "McIDAS-V Zipped Data Bundles (*.mcvz)", SUFFIX_MCVZ);
375
376    /** File filter used for bundle files. */
377    PatternFileFilter FILTER_MCVMCVZ =
378        new PatternFileFilter("(.+\\.mcv$|.+\\.mcvz$)", "All McIDAS-V Bundles (*.mcv,*.mcvz)", SUFFIX_MCV);
379    
380    /** Default port for local ADDE servers. */
381    String LOCAL_ADDE_PORT = "8112";
382    
383    String PROP_CHAN = "selectedchannel";
384    
385    /** Preference to store what ADDE servers to show. */
386    String PROP_SERVERS = "idv.serverstoshow";
387
388    /** Preference to store whether to show all ADDE servers. */
389    String PROP_SERVERS_ALL = "idv.serverstoshow.all";
390    
391    /** Name to store the total system memory. */
392    String PROP_SYSMEM = "idv.sysmem";
393    
394    /** Default map z-level */
395    double DEFAULT_MAP_Z_LEVEL = -0.99d;
396
397    /** Maximum amount of memory 32bit JREs can address, in megabytes. */
398    int MAX_MEMORY_32BIT = 1536;
399    
400    /** A particular shade of blue we are using for branding. */
401    Color MCV_BLUE = new Color(96, 176, 224);
402    Color MCV_BLUE_DARK = new Color(0, 96, 255);
403
404    /** default color picker size */
405    Dimension DEFAULT_COLOR_PICKER_SIZE = new Dimension(24, 20);
406
407    /** Identifier for the {@literal "monitor panel"} window component. */
408    String COMP_MONITORPANEL = "mcv.monitorpanel";
409    
410    /** Default user directory name */
411    String USER_DIRECTORY_NAME = "McIDAS-V";
412
413    /** Tooltip for adaptive resolution menu items. */
414    String TOOLTIP_PROGRESSIVE_RESOLUTION = "This feature can be turned on or off in the \"Display Window\" section of the User Preferences.";
415
416    /** EventBus topic for signaling that directory monitors may begin. */
417    String EVENT_FILECHOOSER_START = "FileChooser.StartWatchService";
418
419    /** EventBus topic for signaling that directory monitors should stop. */
420    String EVENT_FILECHOOSER_STOP = "FileChooser.StopWatchService";
421}