本文整理汇总了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());
}
}
示例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));
}
示例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());
}
}
示例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;*/
//}
}
示例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());
}
}
示例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;
}
}
示例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();
}
}
示例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();
}
示例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());
}
}
示例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;
}
示例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();
}
示例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);
}
示例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());
}
示例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();
}
示例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));
}