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", true);
027  /**
028   * If false, all sequences that cross the download bounds are put completely into the StreetsideData object.
029   * Otherwise only all images (!) inside the download bounds are added, the others are discarded.
030   */
031  public static final BooleanProperty CUT_OFF_SEQUENCES_AT_BOUNDS =
032    new BooleanProperty("streetside.cut-off-sequences-at-bounds", false);
033  public static final IntegerProperty MAPOBJECT_ICON_SIZE = new IntegerProperty("streetside.mapobjects.iconsize", 32);
034  public static final IntegerProperty MAX_MAPOBJECTS = new IntegerProperty("streetside.mapobjects.maximum-number", 200);
035  public static final BooleanProperty SHOW_DETECTED_SIGNS = new BooleanProperty("streetside.show-detected-signs", true);
036  public static final BooleanProperty SHOW_HIGH_RES_STREETSIDE_IMAGERY = new BooleanProperty("streetside.show-high-res-streetside-imagery", true);
037
038  /**
039   * See {@code OsmDataLayer#PROPERTY_BACKGROUND_COLOR}
040   */
041  public static final NamedColorProperty BACKGROUND = new NamedColorProperty("background", Color.BLACK);
042  /**
043   * See {@code OsmDataLayer#PROPERTY_OUTSIDE_COLOR}
044   */
045  public static final NamedColorProperty OUTSIDE_DOWNLOADED_AREA = new NamedColorProperty("outside downloaded area", Color.YELLOW);
046
047  public static final DoubleProperty MAX_DOWNLOAD_AREA = new DoubleProperty("streetside.max-download-area", 0.015);
048
049  public static final IntegerProperty PICTURE_DRAG_BUTTON = new IntegerProperty("streetside.picture-drag-button", 3);
050  public static final IntegerProperty PICTURE_OPTION_BUTTON = new IntegerProperty("streetside.picture-option-button", 2);
051  public static final IntegerProperty PICTURE_ZOOM_BUTTON = new IntegerProperty("streetside.picture-zoom-button", 1);
052  public static final IntegerProperty SEQUENCE_MAX_JUMP_DISTANCE =
053    new IntegerProperty("streetside.sequence-max-jump-distance", 100);
054
055  public static final StringProperty ACCESS_TOKEN = new StringProperty("streetside.access-token", null);
056  public static final StringProperty DOWNLOAD_MODE =
057    new StringProperty("streetside.download-mode", StreetsideDownloader.DOWNLOAD_MODE.DEFAULT.getPrefId());
058  public static final StringProperty START_DIR =
059    new StringProperty("streetside.start-directory", System.getProperty("user.home"));
060  public static final StringProperty URL_CLIENT_ID =
061    new StringProperty("streetside.url-clientid", System.getProperty("T1Fzd20xZjdtR0s1VDk5OFNIOXpYdzoxNDYyOGRkYzUyYTFiMzgz"));
062  public static final StringProperty BING_MAPS_KEY =
063    new StringProperty("streetside.bing-maps-key", System.getProperty("AuftgJsO0Xs8Ts4M1xZUQJQXJNsvmh3IV8DkNieCiy3tCwCUMq76-WpkrBtNAuEm"));
064  public static final StringProperty TEST_BUBBLE_ID =
065    new StringProperty("streetside.test-bubble-id", System.getProperty("80848005"));
066
067  /**
068   * The number of times the help popup for the {@link ImageInfoPanel} will be displayed.
069   * But regardless of this number, the popup will only show up at most once between two (re)starts of JOSM.
070   * Or opening the {@link ImageInfoPanel} immediately brings this number down to zero.
071   */
072  public static final IntegerProperty IMAGEINFO_HELP_COUNTDOWN =
073    new IntegerProperty("streetside.imageInfo.helpDisplayedCountdown", 4);
074
075  /**
076   * The number of times the help popup for the {@link StreetsideViewerPanel} will be displayed.
077   * But regardless of this number, the popup will only show up at most once between two (re)starts of JOSM.
078   * Or opening the {@link StreetsideViewerPanel} immediately brings this number down to zero.
079   */
080  public static final IntegerProperty STREETSIDE_VIEWER_HELP_COUNTDOWN =
081    new IntegerProperty("streetside.streetsideViewer.helpDisplayedCountdown", 4);
082
083  /**
084   * The number of images to be prefetched when a streetside image is selected
085   */
086  public static final IntegerProperty PRE_FETCH_IMAGE_COUNT = new IntegerProperty("streetside.prefetch-image-count", 2);
087
088  /**
089   * The number of images to be prefetched when a streetside image is selected
090   */
091  public static final IntegerProperty PRE_FETCH_CUBEMAP_COUNT = new IntegerProperty("streetside.prefetch-image-count", 2);
092
093
094  private StreetsideProperties() {
095    // Private constructor to avoid instantiation
096  }
097}