当前位置: 首页>>代码示例>>Java>>正文


Java Config类代码示例

本文整理汇总了Java中org.esa.snap.runtime.Config的典型用法代码示例。如果您正苦于以下问题:Java Config类的具体用法?Java Config怎么用?Java Config使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Config类属于org.esa.snap.runtime包,在下文中一共展示了Config类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ensureDefaultDirSet

import org.esa.snap.runtime.Config; //导入依赖的package包/类
private void ensureDefaultDirSet() {
    if (!Files.exists(defaultEndmemberDir)) {
        Path sourceDirPath = ResourceInstaller.findModuleCodeBasePath(SpectralUnmixingDialog.class).resolve("auxdata");
        final ResourceInstaller resourceInstaller = new ResourceInstaller(sourceDirPath, defaultEndmemberDir);
        try {
            resourceInstaller.install(".*", com.bc.ceres.core.ProgressMonitor.NULL);
        } catch (IOException e) {
            // failed, so what
        }
    }

    final String key = DiagramGraphIO.DIAGRAM_GRAPH_IO_LAST_DIR_KEY;
    final Preferences preferences = Config.instance().preferences();
    if (preferences.get(key, null) == null) {
        preferences.put(key, defaultEndmemberDir.toAbsolutePath().toString());
    }
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:18,代码来源:EndmemberFormModel.java

示例2: load

import org.esa.snap.runtime.Config; //导入依赖的package包/类
void load() {
    final Preferences preferences = Config.instance("s2tbx").load().preferences();

    detectorFootprintMasks.setSelected(
            preferences.getBoolean("s2tbx.dataio.detectorFootprintMasks", true));
    radiometricQualityMasks.setSelected(
            preferences.getBoolean("s2tbx.dataio.radiometricQualityMasks", true));
    technicalQualityMasks.setSelected(
            preferences.getBoolean("s2tbx.dataio.technicalQualityMasks", true));
    cloudMasks.setSelected(
            preferences.getBoolean("s2tbx.dataio.cloudMasks", true));
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:13,代码来源:S2ReaderMasksPanel.java

示例3: store

import org.esa.snap.runtime.Config; //导入依赖的package包/类
void store() {
    final Preferences preferences = Config.instance("s2tbx").load().preferences();

    preferences.putBoolean("s2tbx.dataio.detectorFootprintMasks", detectorFootprintMasks.isSelected());
    preferences.putBoolean("s2tbx.dataio.radiometricQualityMasks", radiometricQualityMasks.isSelected());
    preferences.putBoolean("s2tbx.dataio.technicalQualityMasks", technicalQualityMasks.isSelected());
    preferences.putBoolean("s2tbx.dataio.cloudMasks", cloudMasks.isSelected());

    try {
        preferences.flush();
    } catch (BackingStoreException e) {
        SnapApp.getDefault().getLogger().severe(e.getMessage());
    }
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:15,代码来源:S2ReaderMasksPanel.java

示例4: JP2TileOpImage

import org.esa.snap.runtime.Config; //导入依赖的package包/类
private JP2TileOpImage(Path imageFile, int bandIdx, Path cacheDir, int row, int col,
                       TileLayout tileLayout, MultiLevelModel imageModel, int dataType, int level) throws IOException {
    super(dataType, null, tileLayout.tileWidth, tileLayout.tileHeight,
            getTileDimAtResolutionLevel(tileLayout.tileWidth, tileLayout.tileHeight, level),
            null, ResolutionLevel.create(imageModel, level));

    Assert.notNull(imageFile, "imageFile");
    Assert.notNull(cacheDir, "cacheDir");
    Assert.notNull(tileLayout, "tileLayout");
    Assert.notNull(imageModel, "imageModel");

    this.logger = SystemUtils.LOG;
    this.imageFile = imageFile;
    this.cacheDir = cacheDir;
    this.tileLayout = tileLayout;
    this.tileIndex = col + row * tileLayout.numXTiles;
    this.bandIndex = bandIdx;
    this.dataType = dataType;

    //if (useOpenJp2Jna == null) {
        /* Uncomment to use the direct openJp2 decompression */
        String openJp2 = OpenJpegExecRetriever.getOpenJp2();
        useOpenJp2Jna = Boolean.parseBoolean(Config.instance("s2tbx").preferences().get("use.openjp2.jna", "false")) &&
                openJp2 != null && tileLayout.numBands == 1;
        /*useOpenJp2Jna = false;*/
    //}
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:28,代码来源:JP2TileOpImage.java

示例5: store

import org.esa.snap.runtime.Config; //导入依赖的package包/类
void store() {
    final Preferences preferences = Config.instance("s2tbx").load().preferences();
    preferences.put(S2CacheUtils.SENTINEL_2_CACHE_MAX_TIME,
                    box.getSelectedItem().toString());
    try {
        preferences.flush();
    } catch (BackingStoreException e) {
        SnapApp.getDefault().getLogger().severe(e.getMessage());
    }
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:11,代码来源:S2CacheOptionsPanel.java

示例6: start

import org.esa.snap.runtime.Config; //导入依赖的package包/类
@Override
public void start() {
    final Preferences preferences = Config.instance("s2tbx").load().preferences();
    String cachePolicy = preferences.get(S2CacheUtils.SENTINEL_2_CACHE_MAX_TIME, null);
    if(cachePolicy == null) {
        cachePolicy = S2CacheUtils.SENTINEL_2_CACHE_OPTION_WEEK;
        preferences.put(S2CacheUtils.SENTINEL_2_CACHE_MAX_TIME, cachePolicy);
        try {
            preferences.flush();
        } catch (BackingStoreException e) {
            Logger logger = Engine.getInstance().getLogger();
            logger.severe(e.getMessage());
        }
    }

    if (cachePolicy.equals(S2CacheUtils.SENTINEL_2_CACHE_OPTION_NEVER_DELETE)) {
        return;
    }
    if (cachePolicy.equals(S2CacheUtils.SENTINEL_2_CACHE_OPTION_DAY)) {
        S2CacheUtils.delete1DayCache();
        return;
    }
    if (cachePolicy.equals(S2CacheUtils.SENTINEL_2_CACHE_OPTION_WEEK)) {
        S2CacheUtils.delete1WeekCache();
        return;
    }
    if (cachePolicy.equals(S2CacheUtils.SENTINEL_2_CACHE_OPTION_MONTH)) {
        S2CacheUtils.delete1MonthCache();
        return;
    }
    if (cachePolicy.equals(S2CacheUtils.SENTINEL_2_CACHE_OPTION_EACH_START_UP)) {
        S2CacheUtils.deleteCache();
        return;
    }
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:36,代码来源:S2CacheActivator.java

示例7: stop

import org.esa.snap.runtime.Config; //导入依赖的package包/类
@Override
public void stop() {
    final Preferences preferences = Config.instance("s2tbx").load().preferences();
    String cachePolicy = preferences.get(S2CacheUtils.SENTINEL_2_CACHE_MAX_TIME, null);
    if (cachePolicy == null) {
        return;
    }
    if (cachePolicy.equals(S2CacheUtils.SENTINEL_2_CACHE_OPTION_EACH_START_UP)) {
        S2CacheUtils.deleteCache();
    }
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:12,代码来源:S2CacheActivator.java

示例8: SnapFileChooser

import org.esa.snap.runtime.Config; //导入依赖的package包/类
public SnapFileChooser(File currentDirectory, FileSystemView fsv) {
    super(currentDirectory, fsv);
    snapPreferences = Config.instance("snap").preferences();
    resizeHandler = new ResizeHandler();
    windowCloseHandler = new CloseHandler();
    init();
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:8,代码来源:SnapFileChooser.java

示例9: store

import org.esa.snap.runtime.Config; //导入依赖的package包/类
void store() {
    final Preferences preferences = Config.instance().preferences();
    preferences.putBoolean(WWWorldViewToolView.useFlatEarth, useFlatEarthCheckBox.isSelected());

    try {
        preferences.flush();
    } catch (BackingStoreException e) {
        SnapApp.getDefault().getLogger().severe(e.getMessage());
    }
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:11,代码来源:WorldWindOptionsPanel.java

示例10: createFileChooser

import org.esa.snap.runtime.Config; //导入依赖的package包/类
private JFileChooser createFileChooser() {
    String lastDirPath = Config.instance().load().preferences().get(GCP_EXPORT_DIR_PREFERENCES_KEY,
                                                                    SystemUtils.getUserHomeDir().getPath());
    SnapFileChooser fileChooser = new SnapFileChooser();

    HelpCtx.setHelpIDString(fileChooser, getHelpCtx().getHelpID());
    fileChooser.setAcceptAllFileFilterUsed(false);
    fileChooser.setCurrentDirectory(new File(lastDirPath));

    fileChooser.setFileFilter(
            new SnapFileFilter(GCP_FILE_DESCRIPTION, GCP_FILE_EXTENSION, GCP_FILE_DESCRIPTION));
    fileChooser.setDialogTitle(Bundle.CTL_ExportEnviGcpFileAction_DialogTitle());
    fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
    return fileChooser;
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:16,代码来源:ExportEnviGcpFileAction.java

示例11: getPreferences

import org.esa.snap.runtime.Config; //导入依赖的package包/类
private Preferences getPreferences(PropertyDescriptor propertyDescriptor) {
    Object configNameValue = propertyDescriptor.getAttribute("configName");
    String configName = configNameValue != null ? configNameValue.toString().trim() : null;
    if (configName == null || configName.isEmpty()) {
        return SnapApp.getDefault().getPreferences();
    }
    return Config.instance(configName).load().preferences();
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:9,代码来源:DefaultConfigController.java

示例12: onStart

import org.esa.snap.runtime.Config; //导入依赖的package包/类
/**
 * Called if SNAP starts up. The method is not supposed to be called by clients directly.
 * <p>
 * Overrides should call {@code super.onStart()} as a first step unless they know what they are doing.
 */
public void onStart() {
    engine = Engine.start(false);

    String toolbarConfig = "Standard";
    if (Config.instance().debug()) {
        WindowManager.getDefault().setRole("developer");
        toolbarConfig = "Developer";
    }
    // See src/main/resources/org/esa/snap/rcp/layer.xml
    // See src/main/resources/org/esa/snap/rcp/toolbars/Standard.xml
    // See src/main/resources/org/esa/snap/rcp/toolbars/Developer.xml
    ToolbarPool.getDefault().setConfiguration(toolbarConfig);
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:19,代码来源:SnapApp.java

示例13: PlacemarkManagerTopComponent

import org.esa.snap.runtime.Config; //导入依赖的package包/类
public PlacemarkManagerTopComponent(PlacemarkDescriptor placemarkDescriptor, TableModelFactory modelFactory) {
    this.placemarkDescriptor = placemarkDescriptor;
    snapApp = SnapApp.getDefault();
    preferences = snapApp.getPreferences();
    productToSelectedBands = new HashMap<>(50);
    productToSelectedGrids = new HashMap<>(50);
    placemarkTableModel = modelFactory.createTableModel(placemarkDescriptor, product, null, null);
    selectionChangeHandler = new ViewSelectionChangeHandler();
    relatedPlacemarks = new ArrayList<>();
    adjustPinGeoPos = Config.instance().preferences().getBoolean(PREFERENCE_KEY_ADJUST_PIN_GEO_POS, true);
    initUI();
    setDisplayName(getTitle());
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:14,代码来源:PlacemarkManagerTopComponent.java

示例14: load

import org.esa.snap.runtime.Config; //导入依赖的package包/类
void load() {
    final Preferences preferences = Config.instance("s2tbx").load().preferences();
    box.setSelectedItem(preferences.get(S2CacheUtils.SENTINEL_2_CACHE_MAX_TIME,
                                        S2CacheUtils.SENTINEL_2_CACHE_OPTION_WEEK));
    updateLayer();
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:7,代码来源:S2CacheOptionsPanel.java

示例15: start

import org.esa.snap.runtime.Config; //导入依赖的package包/类
@Override
    public void start() {
//        Logger logger = Logger.getLogger(Configuration.DEFAULT_LOGGER_NAME);
        String level = Config.instance().preferences().get(WORLDWIND_LOGLEVEL_KEY, "OFF");
        logger.setLevel(Level.parse(level));
    }
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:7,代码来源:WWActivator.java


注:本文中的org.esa.snap.runtime.Config类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。