001// License: GPL. For details, see LICENSE file.
002package org.openstreetmap.josm.plugins.streetside.utils;
003
004import java.awt.Color;
005
006import org.openstreetmap.josm.data.preferences.BooleanProperty;
007import org.openstreetmap.josm.data.preferences.DoubleProperty;
008import org.openstreetmap.josm.data.preferences.IntegerProperty;
009import org.openstreetmap.josm.data.preferences.NamedColorProperty;
010import org.openstreetmap.josm.data.preferences.StringProperty;
011import org.openstreetmap.josm.plugins.streetside.gui.imageinfo.ImageInfoPanel;
012import org.openstreetmap.josm.plugins.streetside.gui.imageinfo.StreetsideViewerPanel;
013import org.openstreetmap.josm.plugins.streetside.io.download.StreetsideDownloader;
014
015public final class StreetsideProperties {
016  public static final BooleanProperty DELETE_AFTER_UPLOAD = new BooleanProperty("streetside.delete-after-upload", true);
017  public static final BooleanProperty DEVELOPER = new BooleanProperty("streetside.developer", false);
018  public static final BooleanProperty DISPLAY_HOUR = new BooleanProperty("streetside.display-hour", true);
019  public static final BooleanProperty HOVER_ENABLED = new BooleanProperty("streetside.hover-enabled", true);
020  public static final BooleanProperty MOVE_TO_IMG = new BooleanProperty("streetside.move-to-picture", true);
021  public static final BooleanProperty TIME_FORMAT_24 = new BooleanProperty("streetside.format-24", false);
022  public static final BooleanProperty IMAGE_LINK_TO_BLUR_EDITOR = new BooleanProperty("streetside.image-link-to-blur-editor", true);
023  public static final BooleanProperty CUBEMAP_LINK_TO_BLUR_EDITOR = new BooleanProperty("streetside.cubemap-link-to-blur-editor", true);
024  public static final IntegerProperty TILE_DOWNLOAD_THREAD_PAUSE_LEN_SEC = new IntegerProperty("streetside.tile-download-thread-pause-len-sec", 60);
025  public static final BooleanProperty PREDOWNLOAD_CUBEMAPS = new BooleanProperty("streetside.predownload-cubemaps", false);
026  public static final BooleanProperty DEBUGING_ENABLED = new BooleanProperty("streetside.debugging-enabled", false);
027  public static final BooleanProperty DOWNLOAD_CUBEFACE_TILES_TOGETHER = new BooleanProperty("streetside.download-cubeface-tiles-together", false);
028
029  /**
030   * If false, all sequences that cross the download bounds are put completely into the StreetsideData object.
031   * Otherwise only all images (!) inside the download bounds are added, the others are discarded.
032   */
033  public static final BooleanProperty CUT_OFF_SEQUENCES_AT_BOUNDS =
034    new BooleanProperty("streetside.cut-off-sequences-at-bounds", false);
035  public static final IntegerProperty MAPOBJECT_ICON_SIZE = new IntegerProperty("streetside.mapobjects.iconsize", 32);
036  public static final IntegerProperty MAX_MAPOBJECTS = new IntegerProperty("streetside.mapobjects.maximum-number", 200);
037  public static final BooleanProperty SHOW_DETECTED_SIGNS = new BooleanProperty("streetside.show-detected-signs", true);
038  public static final BooleanProperty SHOW_HIGH_RES_STREETSIDE_IMAGERY = new BooleanProperty("streetside.show-high-res-streetside-imagery", true);
039
040  /**
041   * See {@code OsmDataLayer#PROPERTY_BACKGROUND_COLOR}
042   */
043  public static final NamedColorProperty BACKGROUND = new NamedColorProperty("background", Color.BLACK);
044  /**
045   * See {@code OsmDataLayer#PROPERTY_OUTSIDE_COLOR}
046   */
047  public static final NamedColorProperty OUTSIDE_DOWNLOADED_AREA = new NamedColorProperty("outside downloaded area", Color.YELLOW);
048
049  public static final DoubleProperty MAX_DOWNLOAD_AREA = new DoubleProperty("streetside.max-download-area", 0.015);
050
051  public static final IntegerProperty PICTURE_DRAG_BUTTON = new IntegerProperty("streetside.picture-drag-button", 3);
052  public static final IntegerProperty PICTURE_OPTION_BUTTON = new IntegerProperty("streetside.picture-option-button", 2);
053  public static final IntegerProperty PICTURE_ZOOM_BUTTON = new IntegerProperty("streetside.picture-zoom-button", 1);
054  public static final IntegerProperty SEQUENCE_MAX_JUMP_DISTANCE =
055    new IntegerProperty("streetside.sequence-max-jump-distance", 100);
056
057  public static final StringProperty ACCESS_TOKEN = new StringProperty("streetside.access-token", null);
058  public static final StringProperty DOWNLOAD_MODE =
059    new StringProperty("streetside.download-mode", StreetsideDownloader.DOWNLOAD_MODE.DEFAULT.getPrefId());
060  public static final StringProperty START_DIR =
061    new StringProperty("streetside.start-directory", System.getProperty("user.home"));
062  public static final StringProperty URL_CLIENT_ID =
063    new StringProperty("streetside.url-clientid", System.getProperty("T1Fzd20xZjdtR0s1VDk5OFNIOXpYdzoxNDYyOGRkYzUyYTFiMzgz"));
064  public static final StringProperty BING_MAPS_KEY =
065    new StringProperty("streetside.bing-maps-key", System.getProperty("AuftgJsO0Xs8Ts4M1xZUQJQXJNsvmh3IV8DkNieCiy3tCwCUMq76-WpkrBtNAuEm"));
066  public static final StringProperty TEST_BUBBLE_ID =
067    new StringProperty("streetside.test-bubble-id", System.getProperty("80848005"));
068
069  /**
070   * The number of times the help popup for the {@link ImageInfoPanel} will be displayed.
071   * But regardless of this number, the popup will only show up at most once between two (re)starts of JOSM.
072   * Or opening the {@link ImageInfoPanel} immediately brings this number down to zero.
073   */
074  public static final IntegerProperty IMAGEINFO_HELP_COUNTDOWN =
075    new IntegerProperty("streetside.imageInfo.helpDisplayedCountdown", 4);
076
077  /**
078   * The number of times the help popup for the {@link StreetsideViewerPanel} will be displayed.
079   * But regardless of this number, the popup will only show up at most once between two (re)starts of JOSM.
080   * Or opening the {@link StreetsideViewerPanel} immediately brings this number down to zero.
081   */
082  public static final IntegerProperty STREETSIDE_VIEWER_HELP_COUNTDOWN =
083    new IntegerProperty("streetside.streetsideViewer.helpDisplayedCountdown", 4);
084
085  /**
086   * The number of images to be prefetched when a streetside image is selected
087   */
088  public static final IntegerProperty PRE_FETCH_IMAGE_COUNT = new IntegerProperty("streetside.prefetch-image-count", 2);
089
090  /**
091   * The number of images to be prefetched when a streetside image is selected
092   */
093  public static final IntegerProperty PRE_FETCH_CUBEMAP_COUNT = new IntegerProperty("streetside.prefetch-image-count", 2);
094
095
096  private StreetsideProperties() {
097    // Private constructor to avoid instantiation
098  }
099}