    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", true);
    026
    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
    061  /**
    062   * The number of times the help popup for the {@link ImageInfoPanel} will be displayed.
    063   * But regardless of this number, the popup will only show up at most once between two (re)starts of JOSM.
    064   * Or opening the {@link ImageInfoPanel} immediately brings this number down to zero.
    065   */
    066  public static final IntegerProperty IMAGEINFO_HELP_COUNTDOWN =
    067    new IntegerProperty("streetside.imageInfo.helpDisplayedCountdown", 4);
    068
    069  /**
    070   * The number of times the help popup for the {@link StreetsideViewerPanel} 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 StreetsideViewerPanel} immediately brings this number down to zero.
    073   */
    074  public static final IntegerProperty STREETSIDE_VIEWER_HELP_COUNTDOWN =
    075    new IntegerProperty("streetside.streetsideViewer.helpDisplayedCountdown", 4);
    076
    077  /**
    078   * The number of images to be prefetched when a streetside image is selected
    079   */
    080  public static final IntegerProperty PRE_FETCH_IMAGE_COUNT = new IntegerProperty("streetside.prefetch-image-count", 2);
    081
    082  /**
    083   * The number of images to be prefetched when a streetside image is selected
    084   */
    085  public static final IntegerProperty PRE_FETCH_CUBEMAP_COUNT = new IntegerProperty("streetside.prefetch-image-count", 2);
    086
    087
    088  private StreetsideProperties() {
    089    // Private constructor to avoid instantiation
    090  }
    091}