本文整理汇总了Java中org.esa.snap.core.gpf.OperatorSpi类的典型用法代码示例。如果您正苦于以下问题:Java OperatorSpi类的具体用法?Java OperatorSpi怎么用?Java OperatorSpi使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OperatorSpi类属于org.esa.snap.core.gpf包,在下文中一共展示了OperatorSpi类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: SimpleExampleDialog
import org.esa.snap.core.gpf.OperatorSpi; //导入依赖的package包/类
public SimpleExampleDialog(String alias, AppContext appContext, String title, String helpId) {
super(appContext, title, helpId);
this.alias = alias;
final OperatorSpi operatorSpi = GPF.getDefaultInstance().getOperatorSpiRegistry().getOperatorSpi(alias);
parameterSupport = new OperatorParameterSupport(operatorSpi.getOperatorDescriptor());
form = new SimpleForm(appContext, operatorSpi, parameterSupport.getPropertySet(),
getTargetProductSelector());
OperatorMenu operatorMenu = new OperatorMenu(this.getJDialog(),
operatorSpi.getOperatorDescriptor(),
parameterSupport,
appContext,
helpId);
getJDialog().setJMenuBar(operatorMenu.createDefaultMenu());
}
开发者ID:senbox-org,项目名称:snap-examples,代码行数:17,代码来源:SimpleExampleDialog.java
示例2: S2tbxMosaicDialog
import org.esa.snap.core.gpf.OperatorSpi; //导入依赖的package包/类
S2tbxMosaicDialog(final String title, final String helpID, AppContext appContext) {
super(appContext, title, ID_APPLY_CLOSE, helpID);
final TargetProductSelector selector = getTargetProductSelector();
selector.getModel().setSaveToFileSelected(false);
selector.getModel().setProductName("Multi-size Mosaic");
selector.getSaveToFileCheckBox().setEnabled(true);
form = new S2tbxMosaicForm(selector, appContext);
final OperatorSpi operatorSpi = GPF.getDefaultInstance().getOperatorSpiRegistry().getOperatorSpi("Multi-size Mosaic");
S2tbxMosaicFormModel formModel = form.getFormModel();
OperatorParameterSupport parameterSupport = new OperatorParameterSupport(operatorSpi.getOperatorDescriptor(),
formModel.getPropertySet(),
formModel.getParameterMap(),
null);
OperatorMenu operatorMenu = new OperatorMenu(this.getJDialog(),
operatorSpi.getOperatorDescriptor(),
parameterSupport,
appContext,
helpID);
getJDialog().setJMenuBar(operatorMenu.createDefaultMenu());
}
开发者ID:senbox-org,项目名称:s2tbx,代码行数:23,代码来源:S2tbxMosaicDialog.java
示例3: computePostProcessProduct
import org.esa.snap.core.gpf.OperatorSpi; //导入依赖的package包/类
private void computePostProcessProduct() {
postProcessingProduct = s2ClassifProduct;
Product cloudBufferProduct = null;
if (computeCloudBuffer) {
HashMap<String, Product> input = new HashMap<>();
input.put("l1c", sourceProduct);
input.put("s2Cloud", s2ClassifProduct);
input.put("classifiedProduct", s2ClassifProduct);
Map<String, Object> paramsBuffer = new HashMap<>();
paramsBuffer.put("cloudBufferWidth", cloudBufferWidth);
cloudBufferProduct = GPF.createProduct(OperatorSpi.getOperatorAlias(S2IdepixCloudBufferOp.class),
paramsBuffer, input);
postProcessingProduct = cloudBufferProduct;
}
if (computeCloudShadow) {
HashMap<String, Product> inputShadow = new HashMap<>();
inputShadow.put("l1c", sourceProduct);
inputShadow.put("s2Classif", s2ClassifProduct);
inputShadow.put("s2CloudBuffer", cloudBufferProduct);
Map<String, Object> params = new HashMap<>();
params.put("computeCloudShadow", computeCloudShadow);
postProcessingProduct = GPF.createProduct(OperatorSpi.getOperatorAlias(S2IdepixPostProcessOp.class),
params, inputShadow);
}
}
开发者ID:senbox-org,项目名称:s2tbx,代码行数:27,代码来源:S2IdepixOp.java
示例4: setIO
import org.esa.snap.core.gpf.OperatorSpi; //导入依赖的package包/类
public void setIO(final File srcFile, final File tgtFile, final String format) {
final String readOperatorAlias = OperatorSpi.getOperatorAlias(ReadOp.class);
final Node readerNode = findNode(graph, readOperatorAlias);
if (readerNode != null) {
final DomElement param = new DefaultDomElement("parameters");
param.createChild("file").setValue(srcFile.getAbsolutePath());
readerNode.setConfiguration(param);
}
final String writeOperatorAlias = OperatorSpi.getOperatorAlias(WriteOp.class);
final Node writerNode = findNode(graph, writeOperatorAlias);
if (writerNode != null && tgtFile != null) {
final DomElement origParam = writerNode.getConfiguration();
origParam.getChild("file").setValue(tgtFile.getAbsolutePath());
if (format != null)
origParam.getChild("formatName").setValue(format);
}
}
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:19,代码来源:GPFProcessor.java
示例5: getPotentialOutputFiles
import org.esa.snap.core.gpf.OperatorSpi; //导入依赖的package包/类
public File[] getPotentialOutputFiles() {
final List<File> fileList = new ArrayList<>();
final Node[] nodes = graph.getNodes();
for (Node n : nodes) {
if (n.getOperatorName().startsWith(OperatorSpi.getOperatorAlias(WriteOp.class))) {
final DomElement config = n.getConfiguration();
final DomElement fileParam = config.getChild("file");
if (fileParam != null) {
final String filePath = fileParam.getValue();
if (filePath != null && !filePath.isEmpty()) {
final File file = new File(filePath);
fileList.add(file);
}
}
}
}
return fileList.toArray(new File[fileList.size()]);
}
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:19,代码来源:GraphExecuter.java
示例6: replaceProductSetWithReaders
import org.esa.snap.core.gpf.OperatorSpi; //导入依赖的package包/类
private void replaceProductSetWithReaders(final GraphNode sourceNode, final String id, final String value) {
final GraphNode newReaderNode = GraphExecuter.createNewGraphNode(graph, graphNodeList,
OperatorSpi.getOperatorAlias(ReadOp.class), id);
newReaderNode.setOperatorUI(null);
final DomElement config = newReaderNode.getNode().getConfiguration();
final DomElement fileParam = new XppDomElement("file");
fileParam.setValue(value);
config.addChild(fileParam);
final String format = CommonReaders.findCommonProductFormat(new File(value));
if(format != null) {
final DomElement formatParam = new XppDomElement("formatName");
formatParam.setValue(format);
config.addChild(formatParam);
}
graphNodeList.switchConnections(sourceNode, newReaderNode.getID());
}
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:20,代码来源:ProductSetUIHandler.java
示例7: BinningDialog
import org.esa.snap.core.gpf.OperatorSpi; //导入依赖的package包/类
protected BinningDialog(AppContext appContext, String title, String helpID) {
super(appContext, title, ID_APPLY_CLOSE_HELP, helpID, new TargetProductSelectorModel(), true);
formModel = new BinningFormModel();
form = new BinningForm(appContext, formModel, getTargetProductSelector());
OperatorSpi operatorSpi = GPF.getDefaultInstance().getOperatorSpiRegistry().getOperatorSpi(OPERATOR_NAME);
ParameterUpdater parameterUpdater = new BinningParameterUpdater();
OperatorParameterSupport parameterSupport = new OperatorParameterSupport(operatorSpi.getOperatorDescriptor(),
formModel.getPropertySet(),
formModel.getParameterMap(),
parameterUpdater);
OperatorMenu operatorMenu = new OperatorMenu(this.getJDialog(),
operatorSpi.getOperatorDescriptor(),
parameterSupport,
appContext,
helpID);
getJDialog().setJMenuBar(operatorMenu.createDefaultMenu());
}
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:21,代码来源:BinningDialog.java
示例8: getBenchmarkOperators
import org.esa.snap.core.gpf.OperatorSpi; //导入依赖的package包/类
private Object[] getBenchmarkOperators() {
ServiceRegistry<BenchmarkOperatorProvider> benchemarkOperatorServiceRegistry =
ServiceRegistryManager.getInstance().getServiceRegistry(BenchmarkOperatorProvider.class);
ServiceLoader.loadServices(benchemarkOperatorServiceRegistry);
Set<BenchmarkOperatorProvider> providers = benchemarkOperatorServiceRegistry.getServices();
TreeSet<String> externalOperatorsAliases = new TreeSet<>();
for(BenchmarkOperatorProvider provider : providers) {
Set<OperatorSpi> operatorSpis = provider.getBenchmarkOperators();
for(OperatorSpi operatorSpi : operatorSpis) {
externalOperatorsAliases.add(operatorSpi.getOperatorAlias());
}
}
return externalOperatorsAliases.toArray();
}
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:17,代码来源:PerformancePanel.java
示例9: ReprojectionDialog
import org.esa.snap.core.gpf.OperatorSpi; //导入依赖的package包/类
ReprojectionDialog(boolean orthorectify, final String title, final String helpID, AppContext appContext) {
super(appContext, title, ID_APPLY_CLOSE, helpID);
form = new ReprojectionForm(getTargetProductSelector(), orthorectify, appContext);
final OperatorSpi operatorSpi = GPF.getDefaultInstance().getOperatorSpiRegistry().getOperatorSpi(OPERATOR_NAME);
ParameterUpdater parameterUpdater = new ReprojectionParameterUpdater();
OperatorParameterSupport parameterSupport = new OperatorParameterSupport(operatorSpi.getOperatorDescriptor(),
null,
null,
parameterUpdater);
OperatorMenu operatorMenu = new OperatorMenu(this.getJDialog(),
operatorSpi.getOperatorDescriptor(),
parameterSupport,
appContext,
helpID);
getJDialog().setJMenuBar(operatorMenu.createDefaultMenu());
}
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:21,代码来源:ReprojectionDialog.java
示例10: getOperatorDescriptor
import org.esa.snap.core.gpf.OperatorSpi; //导入依赖的package包/类
private static OperatorDescriptor getOperatorDescriptor(Class<? extends Operator> opType) {
String operatorAlias = OperatorSpi.getOperatorAlias(opType);
OperatorDescriptor operatorDescriptor;
OperatorSpiRegistry spiRegistry = GPF.getDefaultInstance().getOperatorSpiRegistry();
operatorDescriptor = spiRegistry.getOperatorSpi(operatorAlias).getOperatorDescriptor();
if (operatorDescriptor == null) {
Class<?>[] declaredClasses = opType.getDeclaredClasses();
for (Class<?> declaredClass : declaredClasses) {
if (OperatorSpi.class.isAssignableFrom(declaredClass)) {
operatorDescriptor = spiRegistry.getOperatorSpi(declaredClass.getName()).getOperatorDescriptor();
}
}
}
if (operatorDescriptor == null) {
throw new IllegalStateException("Not able to find SPI for operator class '" + opType.getName() + "'");
}
return operatorDescriptor;
}
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:20,代码来源:OperatorMenu.java
示例11: MosaicDialog
import org.esa.snap.core.gpf.OperatorSpi; //导入依赖的package包/类
MosaicDialog(final String title, final String helpID, AppContext appContext) {
super(appContext, title, ID_APPLY_CLOSE, helpID);
final TargetProductSelector selector = getTargetProductSelector();
selector.getModel().setSaveToFileSelected(true);
selector.getModel().setProductName("mosaic");
selector.getSaveToFileCheckBox().setEnabled(false);
form = new MosaicForm(selector, appContext);
final OperatorSpi operatorSpi = GPF.getDefaultInstance().getOperatorSpiRegistry().getOperatorSpi("Mosaic");
MosaicFormModel formModel = form.getFormModel();
OperatorParameterSupport parameterSupport = new OperatorParameterSupport(operatorSpi.getOperatorDescriptor(),
formModel.getPropertySet(),
formModel.getParameterMap(),
null);
OperatorMenu operatorMenu = new OperatorMenu(this.getJDialog(),
operatorSpi.getOperatorDescriptor(),
parameterSupport,
appContext,
helpID);
getJDialog().setJMenuBar(operatorMenu.createDefaultMenu());
}
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:23,代码来源:MosaicDialog.java
示例12: CollocationDialog
import org.esa.snap.core.gpf.OperatorSpi; //导入依赖的package包/类
public CollocationDialog(AppContext appContext) {
super(appContext, "Collocation", ID_APPLY_CLOSE, HELP_ID);
final OperatorSpi operatorSpi = GPF.getDefaultInstance().getOperatorSpiRegistry().getOperatorSpi(CollocateOp.Spi.class.getName());
parameterSupport = new OperatorParameterSupport(operatorSpi.getOperatorDescriptor());
OperatorMenu operatorMenu = new OperatorMenu(this.getJDialog(),
operatorSpi.getOperatorDescriptor(),
parameterSupport,
appContext,
HELP_ID);
getJDialog().setJMenuBar(operatorMenu.createDefaultMenu());
form = new CollocationForm(parameterSupport.getPropertySet(), getTargetProductSelector(), appContext);
}
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:17,代码来源:CollocationDialog.java
示例13: setIO
import org.esa.snap.core.gpf.OperatorSpi; //导入依赖的package包/类
private void setIO(final Graph graph, final File srcFile, final File targetFolder) {
final String readOperatorAlias = OperatorSpi.getOperatorAlias(ReadOp.class);
final Node readerNode = findNode(graph, readOperatorAlias);
if (readerNode != null) {
final DomElement param = new DefaultDomElement("parameters");
param.createChild("file").setValue(srcFile.getAbsolutePath());
readerNode.setConfiguration(param);
}
Node[] nodes = graph.getNodes();
if (nodes.length > 0) {
Node lastNode = nodes[nodes.length - 1];
DomElement configuration = lastNode.getConfiguration();
configuration.getChild("targetDir").setValue(targetFolder.getAbsolutePath());
}
}
开发者ID:bcdev,项目名称:esa-pfa,代码行数:17,代码来源:PatchProcessor.java
示例14: SimpleForm
import org.esa.snap.core.gpf.OperatorSpi; //导入依赖的package包/类
public SimpleForm(AppContext appContext, OperatorSpi operatorSpi, PropertySet propertySet,
TargetProductSelector targetProductSelector) {
this.appContext = appContext;
this.operatorSpi = operatorSpi;
this.propertySet = propertySet;
this.targetProductSelector = targetProductSelector;
ioParamPanel = createIOParamTab();
addTab("I/O Parameters", ioParamPanel);
addTab("Processing Parameters", createProcessingParamTab());
}
开发者ID:senbox-org,项目名称:snap-examples,代码行数:12,代码来源:SimpleForm.java
示例15: RadiometricIndicesPanel
import org.esa.snap.core.gpf.OperatorSpi; //导入依赖的package包/类
RadiometricIndicesPanel(String operatorName, PropertySet propertySet, BindingContext bindingContext, Callable<Product> productAccessor) {
if (productAccessor == null) {
throw new IllegalArgumentException("The accessor for fetching source products must not be null");
}
OperatorSpi operatorSpi = GPF.getDefaultInstance().getOperatorSpiRegistry().getOperatorSpi(operatorName);
if (operatorSpi == null) {
throw new IllegalArgumentException("No SPI found for operator name '" + operatorName + "'");
}
this.operatorDescriptor = operatorSpi.getOperatorDescriptor();
this.propertySet = propertySet;
this.bindingContext = bindingContext == null ? new BindingContext(propertySet) : bindingContext;
this.sourceProductAccessor = productAccessor;
PropertyPane parametersPane = new PropertyPane(this.bindingContext);
this.operatorPanel = new JScrollPane(parametersPane.createPanel());
}
开发者ID:senbox-org,项目名称:s2tbx,代码行数:16,代码来源:RadiometricIndicesPanel.java
示例16: processSentinel2
import org.esa.snap.core.gpf.OperatorSpi; //导入依赖的package包/类
private void processSentinel2() {
processLandWaterMask();
Map<String, Product> inputProducts = new HashMap<>(4);
inputProducts.put("l1c", sourceProduct);
inputProducts.put("waterMask", waterMaskProduct);
final Map<String, Object> pixelClassificationParameters = createPixelClassificationParameters();
s2ClassifProduct = GPF.createProduct(OperatorSpi.getOperatorAlias(S2IdepixClassificationOp.class),
pixelClassificationParameters, inputProducts);
if (computeCloudShadow || computeCloudBuffer) {
// Post Cloud Classification: cloud shadow, cloud buffer
computePostProcessProduct();
targetProduct = S2IdepixUtils.cloneProduct(s2ClassifProduct, true);
Band cloudFlagBand = targetProduct.getBand(S2IdepixUtils.IDEPIX_CLASSIF_FLAGS);
cloudFlagBand.setSourceImage(postProcessingProduct.getBand(S2IdepixUtils.IDEPIX_CLASSIF_FLAGS).getSourceImage());
} else {
targetProduct = s2ClassifProduct;
}
// new bit masks:
S2IdepixUtils.setupIdepixCloudscreeningBitmasks(targetProduct);
setTargetProduct(targetProduct);
}
开发者ID:senbox-org,项目名称:s2tbx,代码行数:30,代码来源:S2IdepixOp.java
示例17: CreateOpTab
import org.esa.snap.core.gpf.OperatorSpi; //导入依赖的package包/类
@Override
public JComponent CreateOpTab(String operatorName, Map<String, Object> parameterMap, AppContext appContext) {
OperatorSpi operatorSpi = GPF.getDefaultInstance().getOperatorSpiRegistry().getOperatorSpi(operatorName);
if (operatorSpi == null) {
throw new IllegalArgumentException("No SPI found for operator name '" + operatorName + "'");
}
operatorDescriptor = operatorSpi.getOperatorDescriptor();
parameterSupport = new OperatorParameterSupport(operatorDescriptor);
final PropertySet propertySet = parameterSupport.getPropertySet();
bindingContext = new BindingContext(propertySet);
if (sourceProducts != null) {
for (Band band : sourceProducts[0].getBands()) {
listBands.add(band.getName());
}
}
initializeOperatorUI(operatorName, parameterMap);
final JComponent panel = createPanel();
initParameters();
return new JScrollPane(panel);
}
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:29,代码来源:ResamplingUI.java
示例18: getOperatorCategory
import org.esa.snap.core.gpf.OperatorSpi; //导入依赖的package包/类
public String getOperatorCategory(String alias) {
final OperatorSpiRegistry registry = gpf.getOperatorSpiRegistry();
final OperatorSpi operatorSpi = registry.getOperatorSpi(alias);
final OperatorMetadata operatorMetadata = operatorSpi.getOperatorClass().getAnnotation(OperatorMetadata.class);
if (operatorMetadata != null)
return operatorMetadata.category();
return "";
}
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:9,代码来源:GraphExecuter.java
示例19: moveWriterToLast
import org.esa.snap.core.gpf.OperatorSpi; //导入依赖的package包/类
private void moveWriterToLast(final Graph graph) {
final String writeOperatorAlias = OperatorSpi.getOperatorAlias(WriteOp.class);
final GraphNode writerNode = graphNodeList.findGraphNode(writeOperatorAlias);
if (writerNode != null) {
removeNode(writerNode);
graphNodeList.add(writerNode);
graph.addNode(writerNode.getNode());
}
}
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:11,代码来源:GraphExecuter.java
示例20: getProductsToOpenInDAT
import org.esa.snap.core.gpf.OperatorSpi; //导入依赖的package包/类
public List<File> getProductsToOpenInDAT() {
final List<File> fileList = new ArrayList<>(2);
final Node[] nodes = graph.getNodes();
for (Node n : nodes) {
if (n.getOperatorName().equalsIgnoreCase(OperatorSpi.getOperatorAlias(WriteOp.class))) {
final DomElement config = n.getConfiguration();
final DomElement fileParam = config.getChild("file");
if (fileParam != null) {
final String filePath = fileParam.getValue();
if (filePath != null && !filePath.isEmpty()) {
final File file = new File(filePath);
if (file.exists()) {
fileList.add(file);
} else {
final DomElement formatParam = config.getChild("formatName");
final String format = formatParam.getValue();
final String ext = ReaderUtils.findExtensionForFormat(format);
File newFile = new File(file.getAbsolutePath() + ext);
if (newFile.exists()) {
fileList.add(newFile);
} else {
final String name = FileUtils.getFilenameWithoutExtension(file);
newFile = new File(name + ext);
if (newFile.exists())
fileList.add(newFile);
}
}
}
}
}
}
return fileList;
}
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:36,代码来源:GraphExecuter.java
注:本文中的org.esa.snap.core.gpf.OperatorSpi类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论