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


Java AppContext类代码示例

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


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

示例1: SimpleExampleDialog

import org.esa.snap.ui.AppContext; //导入依赖的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.ui.AppContext; //导入依赖的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: getDefaultOutputPath

import org.esa.snap.ui.AppContext; //导入依赖的package包/类
private String getDefaultOutputPath(AppContext appContext) {
    final Property dirProperty = container.getProperty("outputDir");
    String userHomePath = SystemUtils.getUserHomeDir().getAbsolutePath();
    String lastDir = appContext.getPreferences().getPropertyString(PROPERTY_NAME_LAST_OPEN_OUTPUT_DIR, userHomePath);
    String path;
    try {
        path = new File(lastDir).getCanonicalPath();
    } catch (IOException ignored) {
        path = userHomePath;
    }
    try {
        dirProperty.setValue(new File(path));
    } catch (ValidationException ignore) {
    }
    return path;
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:17,代码来源:PixelExtractionIOForm.java

示例4: CreateOpTab

import org.esa.snap.ui.AppContext; //导入依赖的package包/类
@Override
public JComponent CreateOpTab(String operatorName, Map<String, Object> parameterMap, AppContext appContext) {

    paramMap = parameterMap;
    targetProductSelector = new TargetProductSelector(new TargetProductSelectorModel(), true);
    this.appContext = appContext;

    File saveDir = null;
    final Object value = paramMap.get(FILE_PARAMETER);
    if (value != null) {
        final File file = (File) value;
        saveDir = file.getParentFile();
    }

    if (saveDir == null) {
        final String homeDirPath = SystemUtils.getUserHomeDir().getPath();
        final String savePath = SnapApp.getDefault().getPreferences().get(SaveProductAsAction.PREFERENCES_KEY_LAST_PRODUCT_DIR, homeDirPath);
        saveDir = new File(savePath);
    }
    targetProductSelector.getModel().setProductDir(saveDir);

    initParameters();

    return targetProductSelector.createDefaultPanel();
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:26,代码来源:TargetUI.java

示例5: BatchGraphDialog

import org.esa.snap.ui.AppContext; //导入依赖的package包/类
public BatchGraphDialog(final AppContext theAppContext, final String title, final String helpID,
                        final boolean closeOnDone) {
    super(theAppContext.getApplicationWindow(), title, ID_YES | ID_APPLY_CLOSE_HELP, helpID);
    this.appContext = theAppContext;
    this.baseTitle = title;
    this.closeOnDone = closeOnDone;
    openProcessedProducts = true;

    setContent(createUI());

    if (getJDialog().getJMenuBar() == null) {
        final GraphsMenu operatorMenu = new GraphsMenu(getJDialog(), this);
        getJDialog().setJMenuBar(operatorMenu.createDefaultMenu());
    }

    super.getJDialog().setMinimumSize(new Dimension(400, 300));
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:18,代码来源:BatchGraphDialog.java

示例6: GraphBuilderDialog

import org.esa.snap.ui.AppContext; //导入依赖的package包/类
public GraphBuilderDialog(final AppContext theAppContext, final String title, final String helpID, final boolean allowGraphBuilding) {
    super(theAppContext.getApplicationWindow(), title, 0, helpID);

    this.allowGraphBuilding = allowGraphBuilding;
    appContext = theAppContext;
    graphEx = new GraphExecuter();
    graphEx.addObserver(this);

    String lastDir = SnapApp.getDefault().getPreferences().get(LAST_GRAPH_PATH,
                                                               ResourceUtils.getGraphFolder("").toFile().getAbsolutePath());
    if (new File(lastDir).exists()) {
        SnapApp.getDefault().getPreferences().put(LAST_GRAPH_PATH, lastDir);
    }

    initUI();
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:17,代码来源:GraphBuilderDialog.java

示例7: SourceProductPanel

import org.esa.snap.ui.AppContext; //导入依赖的package包/类
public SourceProductPanel(final AppContext appContext) {

        final TableLayout tableLayout = new TableLayout(1);
        tableLayout.setTableAnchor(TableLayout.Anchor.NORTHWEST);
        tableLayout.setTableWeightX(1.0);
        tableLayout.setTableFill(TableLayout.Fill.BOTH);
        tableLayout.setTablePadding(1, 1);

        setLayout(tableLayout);

        // Fetch source products
        sourceProductSelectorList.add(new SourceProductSelector(appContext));

        for (SourceProductSelector selector : sourceProductSelectorList) {
            add(selector.createDefaultPanel());
        }
        add(tableLayout.createVerticalSpacer());

    }
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:20,代码来源:SourceProductPanel.java

示例8: BinningDialog

import org.esa.snap.ui.AppContext; //导入依赖的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

示例9: processingParamsComputeButtonActionPerformed

import org.esa.snap.ui.AppContext; //导入依赖的package包/类
private void processingParamsComputeButtonActionPerformed(java.awt.event.ActionEvent evt) {
    if(validCompute()){
        //Create performance parameters benchmark lists
        java.util.List<String> tileDimensionList = new ArrayList<>();
        java.util.List<Integer> cacheSizesList = new ArrayList<>();
        java.util.List<Integer> nbThreadsList = new ArrayList<>();

        //for(String dimension : StringUtils.split(benchmarkTileDimensionTextField.getText(), ';')){
        //    tileDimensionList.add(dimension);
        //}
        tileDimensionList.add(JAI.getDefaultTileSize().width + "," + JAI.getDefaultTileSize().height);

        for(String cacheSize : StringUtils.split(benchmarkCacheSizeTextField.getText(), ';')){
            cacheSizesList.add(Integer.parseInt(cacheSize));
        }
        for(String nbThread : StringUtils.split(benchmarkNbThreadsTextField.getText(), ';')){
            nbThreadsList.add(Integer.parseInt(nbThread));
        }
        Benchmark benchmarkModel = new Benchmark(tileDimensionList, cacheSizesList, nbThreadsList);
        String opName = procGraphJComboBox.getSelectedItem().toString();
        AppContext appContext = SnapApp.getDefault().getAppContext();
        //launch Benchmark dialog
        BenchmarkDialog productDialog = new BenchmarkDialog(this, opName, benchmarkModel, appContext);
        productDialog.show();
    }
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:27,代码来源:PerformancePanel.java

示例10: CreateOpTab

import org.esa.snap.ui.AppContext; //导入依赖的package包/类
public JComponent CreateOpTab(String operatorName, Map<String, Object> parameterMap, AppContext appContext) {

        initializeOperatorUI(operatorName, parameterMap);
        JComponent panel = createPanel();
        initParameters();

        kernelFile.setColumns(30);
        kernelFileBrowseButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                final File file = Dialogs.requestFileForOpen("User Defined Kernel File", false, null, "snap.filterDir");
                kernelFile.setText(file.getAbsolutePath());
            }
        });

        return panel;
    }
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:17,代码来源:FilterOpUI.java

示例11: SingleTargetProductDialog

import org.esa.snap.ui.AppContext; //导入依赖的package包/类
protected SingleTargetProductDialog(AppContext appContext, String title, int buttonMask, String helpID, TargetProductSelectorModel model, boolean alwaysWriteOutput) {
    super(appContext.getApplicationWindow(), title, buttonMask, helpID);
    this.appContext = appContext;
    targetProductSelector = new TargetProductSelector(model, alwaysWriteOutput);
    String homeDirPath = SystemUtils.getUserHomeDir().getPath();
    String saveDir = appContext.getPreferences().getPropertyString(SaveProductAsAction.PREFERENCES_KEY_LAST_PRODUCT_DIR, homeDirPath);
    targetProductSelector.getModel().setProductDir(new File(saveDir));
    if (!alwaysWriteOutput) {
        targetProductSelector.getOpenInAppCheckBox().setText("Open in " + appContext.getApplicationName());
    }
    targetProductSelector.getModel().getValueContainer().addPropertyChangeListener(evt -> {
        if (evt.getPropertyName().equals("saveToFileSelected") ||
                evt.getPropertyName().equals("openInAppSelected")) {
            updateRunButton();
        }
    });
    AbstractButton button = getButton(ID_APPLY);
    button.setText("Run");
    button.setMnemonic('R');
    updateRunButton();
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:22,代码来源:SingleTargetProductDialog.java

示例12: ReprojectionDialog

import org.esa.snap.ui.AppContext; //导入依赖的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

示例13: ReprojectionForm

import org.esa.snap.ui.AppContext; //导入依赖的package包/类
ReprojectionForm(TargetProductSelector targetProductSelector, boolean orthorectify, AppContext appContext) {
    this.targetProductSelector = targetProductSelector;
    this.orthoMode = orthorectify;
    this.appContext = appContext;
    this.sourceProductSelector = new SourceProductSelector(appContext, "Source Product:");
    if (orthoMode) {
        targetProductSuffix = "orthorectified";
        this.sourceProductSelector.setProductFilter(new OrthorectifyProductFilter());
    } else {
        targetProductSuffix = "reprojected";
        this.sourceProductSelector.setProductFilter(new GeoCodingProductFilter());
    }
    this.reprojectionModel = new Model();
    this.reprojectionContainer = PropertyContainer.createObjectBacked(reprojectionModel);
    createUI();
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:17,代码来源:ReprojectionForm.java

示例14: createPageComponent

import org.esa.snap.ui.AppContext; //导入依赖的package包/类
@Override
public Component createPageComponent() {
    final AppContext snapContext = SnapApp.getDefault().getAppContext();
    final ProductCrsForm productCrsForm = new ProductCrsForm(snapContext, SnapApp.getDefault().getSelectedProduct(VIEW));
    final CustomCrsForm customCrsForm = new CustomCrsForm(snapContext);
    final PredefinedCrsForm predefinedCrsForm = new PredefinedCrsForm(snapContext);


    final TableLayout tableLayout = new TableLayout(1);
    tableLayout.setTablePadding(4, 4);
    tableLayout.setTableWeightX(1.0);
    tableLayout.setTableWeightY(1.0);
    tableLayout.setTableFill(TableLayout.Fill.BOTH);
    final JPanel pageComponent = new JPanel(tableLayout);
    final JLabel label = new JLabel("<html><b>No CRS found for ESRI Shapefile. Please specify.</b>");
    crsSelectionPanel = new CrsSelectionPanel(productCrsForm, customCrsForm, predefinedCrsForm);
    pageComponent.add(label);
    pageComponent.add(crsSelectionPanel);
    return pageComponent;
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:21,代码来源:ShapefileAssistantPage2.java

示例15: OperatorMenu

import org.esa.snap.ui.AppContext; //导入依赖的package包/类
public OperatorMenu(Component parentComponent,
                    OperatorDescriptor opDescriptor,
                    OperatorParameterSupport parameterSupport,
                    AppContext appContext,
                    String helpId) {
    this.parentComponent = parentComponent;
    this.parameterSupport = parameterSupport;
    this.opDescriptor = opDescriptor;
    this.appContext = appContext;
    this.helpId = helpId;
    lastDirPreferenceKey = opDescriptor.getName() + ".lastDir";
    loadParametersAction = new LoadParametersAction();
    saveParametersAction = new SaveParametersAction();
    displayParametersAction = new DisplayParametersAction();
    aboutAction = new AboutOperatorAction();
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:17,代码来源:OperatorMenu.java


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