當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。