本文整理汇总了Java中org.esa.snap.ui.UIUtils类的典型用法代码示例。如果您正苦于以下问题:Java UIUtils类的具体用法?Java UIUtils怎么用?Java UIUtils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UIUtils类属于org.esa.snap.ui包,在下文中一共展示了UIUtils类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addIcon
import org.esa.snap.ui.UIUtils; //导入依赖的package包/类
protected void addIcon(final ModelessDialog dlg) {
String iconName = getIcon();
if (iconName == null) {
//setIcon(dlg, IconUtils.esaPlanetIcon);
} else if (iconName.equals("esaIcon")) {
setIcon(dlg, esaPlanetIcon);
} else if (iconName.equals("rstbIcon")) {
setIcon(dlg, rstbIcon);
} else if (iconName.equals("geoAusIcon")) {
setIcon(dlg, geoAusIcon);
} else {
final ImageIcon icon = UIUtils.loadImageIcon(iconName, OperatorAction.class);
if (icon != null)
setIcon(dlg, icon);
}
}
示例2: createAddInputButton
import org.esa.snap.ui.UIUtils; //导入依赖的package包/类
private AbstractButton createAddInputButton() {
final AbstractButton addButton = ToolButtonFactory.createButton(UIUtils.loadImageIcon("icons/Plus24.gif"),
false);
addButton.addActionListener(e -> {
final JPopupMenu popup = new JPopupMenu("Add");
final Rectangle buttonBounds = addButton.getBounds();
final AddProductAction addProductAction = new AddProductAction(appContext, listModel);
addProductAction.setProductFilter(productFilter);
popup.add(addProductAction);
popup.add(new AddFileAction(appContext, listModel, propertyNameLastOpenInputDir, propertyNameLastOpenedFormat, propertyNameFormatNames));
popup.add(new AddDirectoryAction(appContext, listModel, false, propertyNameLastOpenInputDir, defaultPattern));
popup.add(new AddDirectoryAction(appContext, listModel, true, propertyNameLastOpenInputDir, defaultPattern));
popup.show(addButton, 1, buttonBounds.height + 1);
});
return addButton;
}
示例3: createGeoCoordinatesPane
import org.esa.snap.ui.UIUtils; //导入依赖的package包/类
private JPanel createGeoCoordinatesPane() {
JPanel geoCoordinatesPane = GridBagUtils.createPanel();
setComponentName(geoCoordinatesPane, "geoCoordinatesPane");
GridBagConstraints gbc = GridBagUtils.createConstraints(
"insets.left=3,anchor=WEST,fill=HORIZONTAL, weightx=1.0");
GridBagUtils.setAttributes(gbc, "insets.top=4");
GridBagUtils.addToPanel(geoCoordinatesPane, new JLabel("North latitude bound:"), gbc, "gridx=0,gridy=0");
GridBagUtils.addToPanel(geoCoordinatesPane, UIUtils.createSpinner(paramNorthLat1, 1.0, "#0.00#"),
gbc, "gridx=1,gridy=0");
GridBagUtils.setAttributes(gbc, "insets.top=1");
GridBagUtils.addToPanel(geoCoordinatesPane, new JLabel("West longitude bound:"), gbc, "gridx=0,gridy=1");
GridBagUtils.addToPanel(geoCoordinatesPane, UIUtils.createSpinner(paramWestLon1, 1.0, "#0.00#"),
gbc, "gridx=1,gridy=1");
GridBagUtils.setAttributes(gbc, "insets.top=4");
GridBagUtils.addToPanel(geoCoordinatesPane, new JLabel("South latitude bound:"), gbc, "gridx=0,gridy=2");
GridBagUtils.addToPanel(geoCoordinatesPane, UIUtils.createSpinner(paramSouthLat2, 1.0, "#0.00#"),
gbc, "gridx=1,gridy=2");
GridBagUtils.setAttributes(gbc, "insets.top=1");
GridBagUtils.addToPanel(geoCoordinatesPane, new JLabel("East longitude bound:"), gbc, "gridx=0,gridy=3");
GridBagUtils.addToPanel(geoCoordinatesPane, UIUtils.createSpinner(paramEastLon2, 1.0, "#0.00#"),
gbc, "gridx=1,gridy=3");
return geoCoordinatesPane;
}
示例4: createPixelCoordinatesPane
import org.esa.snap.ui.UIUtils; //导入依赖的package包/类
private JPanel createPixelCoordinatesPane() {
GridBagConstraints gbc = GridBagUtils.createConstraints(
"insets.left=3,anchor=WEST,fill=HORIZONTAL, weightx=1.0");
JPanel pixelCoordinatesPane = GridBagUtils.createPanel();
setComponentName(pixelCoordinatesPane, "pixelCoordinatesPane");
GridBagUtils.setAttributes(gbc, "insets.top=4");
GridBagUtils.addToPanel(pixelCoordinatesPane, new JLabel("Scene start X:"), gbc, "gridx=0,gridy=0");
GridBagUtils.addToPanel(pixelCoordinatesPane, UIUtils.createSpinner(paramX1, 25, "#0"),
gbc, "gridx=1,gridy=0");
GridBagUtils.setAttributes(gbc, "insets.top=1");
GridBagUtils.addToPanel(pixelCoordinatesPane, new JLabel("Scene start Y:"), gbc, "gridx=0,gridy=1");
GridBagUtils.addToPanel(pixelCoordinatesPane, UIUtils.createSpinner(paramY1, 25, "#0"),
gbc, "gridx=1,gridy=1");
GridBagUtils.setAttributes(gbc, "insets.top=4");
GridBagUtils.addToPanel(pixelCoordinatesPane, new JLabel("Scene end X:"), gbc, "gridx=0,gridy=2");
GridBagUtils.addToPanel(pixelCoordinatesPane, UIUtils.createSpinner(paramX2, 25, "#0"),
gbc, "gridx=1,gridy=2");
GridBagUtils.setAttributes(gbc, "insets.top=1");
GridBagUtils.addToPanel(pixelCoordinatesPane, new JLabel("Scene end Y:"), gbc, "gridx=0,gridy=3");
GridBagUtils.addToPanel(pixelCoordinatesPane, UIUtils.createSpinner(paramY2, 25, "#0"),
gbc, "gridx=1,gridy=3");
return pixelCoordinatesPane;
}
示例5: buildUIMinimalDescriptor
import org.esa.snap.ui.UIUtils; //导入依赖的package包/类
public static PropertyUIDescriptor buildUIMinimalDescriptor(ToolParameterDescriptor parameter, String property, ToolAdapterOperatorDescriptor operator, BindingContext context, ActionListener deleteActionListener, ActionListener editActionListener, PropertyMemberUIWrapper.CallBackAfterEdit callback) {
PropertyUIDescriptor descriptor = new PropertyUIDescriptor();
AbstractButton delButton = ToolButtonFactory.createButton(UIUtils.loadImageIcon("/org/esa/snap/resources/images/icons/DeleteShapeTool16.gif"),
false);
delButton.addActionListener(deleteActionListener);
descriptor.setDelButton(delButton);
AbstractButton editButton = new JButton("...");
editButton.addActionListener(editActionListener);
descriptor.setEditButton(editButton);
HashMap<String, PropertyMemberUIWrapper> UIcomponentsMap = new HashMap<>();
UIcomponentsMap.put(property, PropertyMemberUIWrapperFactory.buildPropertyWrapper(property, parameter, operator, context, callback));
descriptor.setUIcomponentsMap(UIcomponentsMap);
return descriptor;
}
示例6: buildUIDescriptor
import org.esa.snap.ui.UIUtils; //导入依赖的package包/类
public static PropertyUIDescriptor buildUIDescriptor(ToolParameterDescriptor prop, String[] columnsMembers, ToolAdapterOperatorDescriptor opDescriptor, BindingContext context, ActionListener deleteActionListener, ActionListener editActionListener, PropertyMemberUIWrapper.CallBackAfterEdit callback) {
PropertyUIDescriptor descriptor = new PropertyUIDescriptor();
AbstractButton delButton = ToolButtonFactory.createButton(UIUtils.loadImageIcon("/org/esa/snap/resources/images/icons/DeleteShapeTool16.gif"),
false);
delButton.addActionListener(deleteActionListener);
descriptor.setDelButton(delButton);
AbstractButton editButton = new JButton("...");
editButton.addActionListener(editActionListener);
descriptor.setEditButton(editButton);
HashMap<String, PropertyMemberUIWrapper> UIcomponentsMap = new HashMap<>();
for (String col : columnsMembers) {
if (!col.equals("del")) {
UIcomponentsMap.put(col, PropertyMemberUIWrapperFactory.buildPropertyWrapper(col, prop, opDescriptor, context, callback));
}
}
descriptor.setUIcomponentsMap(UIcomponentsMap);
return descriptor;
}
示例7: createParametersPanel
import org.esa.snap.ui.UIUtils; //导入依赖的package包/类
private JPanel createParametersPanel() {
JPanel paramsPanel = new JPanel();
BoxLayout layout = new BoxLayout(paramsPanel, BoxLayout.PAGE_AXIS);
paramsPanel.setLayout(layout);
AbstractButton addParamBut = ToolButtonFactory.createButton(UIUtils.loadImageIcon("/org/esa/snap/resources/images/icons/Add16.png"), false);
addParamBut.setAlignmentX(Component.LEFT_ALIGNMENT);
paramsPanel.add(addParamBut);
this.paramsTable = new OperatorParametersTable(this.fakeOperatorDescriptor, appContext);
JScrollPane tableScrollPane = new JScrollPane(paramsTable);
tableScrollPane.setPreferredSize(new Dimension(500, 130));
tableScrollPane.setAlignmentX(Component.LEFT_ALIGNMENT);
paramsPanel.add(tableScrollPane);
addParamBut.addActionListener((ActionEvent e) -> paramsTable.addParameterToTable());
TitledBorder title = BorderFactory.createTitledBorder("Template Parameters");
paramsPanel.setBorder(title);
return paramsPanel;
}
示例8: createParametersPanel
import org.esa.snap.ui.UIUtils; //导入依赖的package包/类
@Override
protected JPanel createParametersPanel() {
JPanel paramsPanel = new JPanel();
BoxLayout layout = new BoxLayout(paramsPanel, BoxLayout.PAGE_AXIS);
paramsPanel.setLayout(layout);
AbstractButton addParamBut = ToolButtonFactory.createButton(UIUtils.loadImageIcon(Bundle.Icon_Add()), false);
addParamBut.setAlignmentX(Component.LEFT_ALIGNMENT);
addParamBut.setAlignmentY(Component.TOP_ALIGNMENT);
paramsPanel.add(addParamBut);
int tableWidth = (formWidth - 2 * DEFAULT_PADDING);
int widths[] = {27, 120, (int)(tableWidth * 0.25), (int)(tableWidth * 0.1), 100, (int)(tableWidth * 0.32), 30};
for(int i=0; i < widths.length; i++) {
paramsTable.getColumnModel().getColumn(i).setPreferredWidth(widths[i]);
}
JScrollPane tableScrollPane = new JScrollPane(paramsTable);
tableScrollPane.setAlignmentX(Component.LEFT_ALIGNMENT);
paramsPanel.add(tableScrollPane);
addParamBut.addActionListener(e -> paramsTable.addParameterToTable(new ToolParameterDescriptor("parameterName", String.class), 0));
TitledBorder title = BorderFactory.createTitledBorder(Bundle.CTL_Panel_OpParams_Border_TitleText());
paramsPanel.setBorder(title);
return paramsPanel;
}
示例9: createParametersPanel
import org.esa.snap.ui.UIUtils; //导入依赖的package包/类
@Override
protected JPanel createParametersPanel() {
JPanel paramsPanel = new JPanel();
BoxLayout layout = new BoxLayout(paramsPanel, BoxLayout.PAGE_AXIS);
paramsPanel.setLayout(layout);
AbstractButton addParamBut = ToolButtonFactory.createButton(UIUtils.loadImageIcon(Bundle.Icon_Add()), false);
addParamBut.setText("New Parameter");
addParamBut.setMaximumSize(new Dimension(150, controlHeight));
addParamBut.setAlignmentX(Component.LEFT_ALIGNMENT);
addParamBut.setAlignmentY(Component.TOP_ALIGNMENT);
paramsPanel.add(addParamBut);
JScrollPane tableScrollPane = new JScrollPane(paramsTable);
tableScrollPane.setAlignmentX(Component.LEFT_ALIGNMENT);
paramsPanel.add(tableScrollPane);
addParamBut.addActionListener(e -> paramsTable.addParameterToTable());
return paramsPanel;
}
示例10: exportVectorDataNode
import org.esa.snap.ui.UIUtils; //导入依赖的package包/类
/**
* Performs the actual "export Mask Pixels" command.
*/
private void exportVectorDataNode() {
SnapApp snapApp = SnapApp.getDefault();
if (vectorDataNode.getFeatureCollection().isEmpty()) {
Dialogs.showInformation(Bundle.CTL_ExportGeometryAction_DialogTitle(),
"The selected geometry is empty. Nothing to export.", null);
return;
}
final File file = promptForFile(vectorDataNode.getName());
if (file == null) {
return;
}
final SwingWorker<Exception, Object> swingWorker = new ExportVectorNodeSwingWorker(snapApp, vectorDataNode, file);
UIUtils.setRootFrameWaitCursor(snapApp.getMainFrame());
snapApp.setStatusBarMessage("Exporting Geometry...");
swingWorker.execute();
}
示例11: done
import org.esa.snap.ui.UIUtils; //导入依赖的package包/类
/**
* Called on the event dispatching thread (not on the worker thread) after the <code>construct</code> method
* has returned.
*/
@Override
public void done() {
Exception exception = null;
try {
UIUtils.setRootFrameDefaultCursor(SnapApp.getDefault().getMainFrame());
snapApp.setStatusBarMessage("");
exception = get();
} catch (InterruptedException | ExecutionException e) {
exception = e;
} finally {
if (exception != null) {
exception.printStackTrace();
Dialogs.showError(Bundle.CTL_ExportGeometryAction_DialogTitle(),
"Can not export geometry.\n" + exception.getMessage());
}
}
}
示例12: doInBackground
import org.esa.snap.ui.UIUtils; //导入依赖的package包/类
@Override
protected Object doInBackground(ProgressMonitor pm) throws Exception {
UIUtils.setRootFrameWaitCursor(ImageInfoEditor2.this);
if (parentForm.getFormModel().isValid()) {
final RasterDataNode[] rasters = parentForm.getFormModel().getRasters();
try {
pm.beginTask("Computing statistics", rasters.length);
for (RasterDataNode raster : rasters) {
raster.getStx(true, SubProgressMonitor.create(pm, 1));
}
} finally {
pm.done();
}
}
return null;
}
示例13: getExportButton
import org.esa.snap.ui.UIUtils; //导入依赖的package包/类
private AbstractButton getExportButton() {
final AbstractButton export = ToolButtonFactory.createButton(UIUtils.loadImageIcon("icons/Export24.gif"),
false);
export.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
JPopupMenu viewPopup = new JPopupMenu("Export");
viewPopup.add(exportAsCsvAction);
viewPopup.add(putStatisticsIntoVectorDataAction);
final Rectangle buttonBounds = export.getBounds();
viewPopup.show(export, 1, buttonBounds.height + 1);
}
});
export.setEnabled(false);
return export;
}
示例14: getTableCellRendererComponent
import org.esa.snap.ui.UIUtils; //导入依赖的package包/类
@Override
public Component getTableCellRendererComponent(JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column) {
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
setForeground(Color.black);
setBackground(Color.white);
if (column == VALUE_COLUMN && value != null) {
if (value.equals("true")) {
setForeground(UIUtils.COLOR_DARK_RED);
setBackground(VERY_LIGHT_BLUE);
} else if (value.equals("false")) {
setForeground(UIUtils.COLOR_DARK_BLUE);
setBackground(VERY_LIGHT_RED);
}
}
return this;
}
示例15: mousePressed
import org.esa.snap.ui.UIUtils; //导入依赖的package包/类
/**
* Invoked when a mouse button has been pressed on a component.
*/
@Override
public void mousePressed(MouseEvent e) {
if (e.getButton() == MouseEvent.BUTTON1) {
switch (patch.getLabel()) {
case RELEVANT:
patch.setLabel(Patch.Label.IRRELEVANT);
break;
case IRRELEVANT:
case NONE:
patch.setLabel(Patch.Label.RELEVANT);
break;
}
repaint();
} else if (e.getButton() == MouseEvent.BUTTON3) {
JPopupMenu popupMenu = patchContextMenuFactory.createContextMenu(patch);
if (popupMenu != null) {
UIUtils.showPopup(popupMenu, e);
}
}
}