private void doSetHelpCtx(final HelpCtx helpCtx ) { if ((wizardPanel != null) && (helpCtx != null)) { HelpCtx.setHelpIDString(wizardPanel, helpCtx.getHelpID()); } // we call the inherited method after setting the ID // on the panel becuase super.setHelpCtx fires the change super.setHelpCtx(helpCtx); }
/** @param comp component * @param action the action */ public Bridge(JComponent comp, Action action) { if(comp == null || action == null) { throw new IllegalArgumentException( "None of the arguments can be null: comp=" + comp + //NOI18N ", action=" + action); // NOI18N } this.comp = comp; this.action = action; actionL = WeakListeners.propertyChange(this, action); // associate context help, if applicable // [PENDING] probably belongs in ButtonBridge.updateState to make it dynamic HelpCtx help = findHelp(action); if ((help != null) && !help.equals(HelpCtx.DEFAULT_HELP) && (help.getHelpID() != null)) { HelpCtx.setHelpIDString(comp, help.getHelpID()); } }
public void setHelpCtx (final HelpCtx helpCtx) { if ((wizardPanel != null) && (helpCtx != null)) { HelpCtx.setHelpIDString(wizardPanel, helpCtx.getHelpID()); } // we call the inherited method after setting the ID // on the panel becuase super.setHelpCtx fires the change super.setHelpCtx(helpCtx); }
public void setHelpCtx (final HelpCtx helpCtx) { if ((wizardPanel != null) && (helpCtx != null)) { HelpCtx.setHelpIDString(wizardPanel, helpCtx.getHelpID()); } // we call the inherited method after setting the ID // on the panel becuase super.setHelpCtx fires the change super.setHelpCtx(helpCtx); }
/** Constructor that permits specification of the action on the node, * and permits overriding the name and icon of the menu. * * @param node node to represent * @param action action called when node selected * @param setName <code>true</code> to automatically set the name and icon of the item */ public Menu(final Node node, NodeAcceptor action, boolean setName) { this.node = node; this.action = action; if (setName) { MenuItem.initialize(this, node); HelpCtx help = node.getHelpCtx(); if ((help != null) && !help.equals(HelpCtx.DEFAULT_HELP) && (help.getHelpID() != null)) { HelpCtx.setHelpIDString(this, help.getHelpID()); } } }
/** Constructor that permits specification of the action on the node, * and permits overriding the name and icon of the menu. * * @param node node to represent * @param action action called when node selected * @param setName <code>true</code> to automatically set the name and icon of the item */ public Menu (final Node node, NodeAcceptor action, boolean setName) { this.node = node; this.action = action; if (setName) { MenuItem.initialize (this, node); HelpCtx help = node.getHelpCtx (); if (help != null && ! help.equals (HelpCtx.DEFAULT_HELP) && help.getHelpID () != null) HelpCtx.setHelpIDString (this, help.getHelpID ()); } }
/** Constructor that permits specification of the action on the node, * and permits overriding the name and icon of the menu. * * @param node node to represent * @param action action called when node selected * @param setName <code>true</code> to automatically set the name and icon of the item */ public Menu (final Node node, NodeAcceptor action, boolean setName) { this.node = node; this.action = action; if (setName) { MenuItem.initialize (this, node); HelpCtx help = node.getHelpCtx (); if (help != null && ! help.equals (HelpCtx.DEFAULT_HELP) && help.getHelpID () != null) HelpCtx.setHelpIDString (this, help.getHelpID ()); } }
/** @param comp component * @param action the action */ public Bridge (JComponent comp, Action action) { this.comp = comp; this.action = action; // visibility listener Bridge.this.comp.addPropertyChangeListener(new VisL()); if (Bridge.this.comp.isShowing ()) { addNotify (); } // associate context help, if applicable // [PENDING] probably belongs in ButtonBridge.updateState to make it dynamic HelpCtx help = findHelp (action); if (help != null && ! help.equals (HelpCtx.DEFAULT_HELP) && help.getHelpID () != null) HelpCtx.setHelpIDString (comp, help.getHelpID ()); }
/** @param comp component * @param action the action */ public Bridge (JComponent comp, Action action) { this.comp = comp; this.action = action; // visibility listener Bridge.this.comp.addPropertyChangeListener(new VisL()); if (Bridge.this.comp.isShowing ()) { addNotify (); } // associate context help, if applicable // [PENDING] probably belongs in ButtonBridge.updateState to make it dynamic HelpCtx help = findHelp (action); if (help != null && ! help.equals (HelpCtx.DEFAULT_HELP) && help.getHelpID () != null) HelpCtx.setHelpIDString (comp, help.getHelpID ()); }
); HelpCtx.setHelpIDString (chooser, getHelpCtx ().getHelpID ());
HelpCtx.setHelpIDString (chooser, getHelpCtx ().getHelpID ());
public JComponent getVisualRepresentation() { if (topComponent == null) { JComponent visualRepresentation = view.getVisualRepresentation(); if (visualRepresentation != null) { if (view.getHelpCtx() != null){ HelpCtx.setHelpIDString(visualRepresentation, view.getHelpCtx().getHelpID()); } topComponent = kind == DataEditorView.Kind.CODE ? new CodeEditorTopComponent(context, lookup, visualRepresentation) : new EditorTopComponent(context, lookup, visualRepresentation); } } return topComponent; }
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; }
private void showResults(MaskAreaStatistics areaStatistics) { final double roundFactor = 10000.0; final double maskAreaR = MathUtils.round(areaStatistics.getMaskArea(), roundFactor); final double meanPixelAreaR = MathUtils.round(areaStatistics.getMaskArea() / areaStatistics.getNumPixels(), roundFactor); final double pixelAreaMinR = MathUtils.round(areaStatistics.getPixelAreaMin(), roundFactor); final double pixelAreaMaxR = MathUtils.round(areaStatistics.getPixelAreaMax(), roundFactor); final JPanel content = GridBagUtils.createPanel(); final GridBagConstraints gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.anchor = GridBagConstraints.WEST; gbc.insets.right = 4; gbc.gridy = 0; gbc.weightx = 0; gbc.insets.top = 2; addField(content, gbc, "Number of Mask pixels:", String.format("%15d", areaStatistics.getNumPixels()), ""); addField(content, gbc, "Mask area:", String.format("%15.3f", maskAreaR), "km^2"); addField(content, gbc, "Mean pixel area:", String.format("%15.3f", meanPixelAreaR), "km^2"); addField(content, gbc, "Minimum pixel area:", String.format("%15.3f", pixelAreaMinR), "km^2"); addField(content, gbc, "Maximum pixel area:", String.format("%15.3f", pixelAreaMaxR), "km^2"); gbc.insets.top = 8; addField(content, gbc, "Mean earth radius:", String.format("%15.3f", areaStatistics.getEarthRadius()), "km"); final ModalDialog dialog = new ModalDialog(SnapApp.getDefault().getMainFrame(), Bundle.CTL_ComputeMaskAreaAction_DialogTitle() + " - " + mask.getDisplayName(), content, ModalDialog.ID_OK | ModalDialog.ID_HELP, getHelpCtx().getHelpID()); dialog.show(); }
if (id != null && !HelpCtx.DEFAULT_HELP.getHelpID().equals(id)) { return new HelpCtx(id); } else {
if ((id != null) && !HelpCtx.DEFAULT_HELP.getHelpID().equals(id)) { return new HelpCtx(id); } else {
@Override protected void configureFileChooser(SnapFileChooser fileChooser, ProductSceneView view, String imageBaseName) { legendParamGroup = createLegendParamGroup(); legendParamGroup.setParameterValues(SnapApp.getDefault().getPreferencesPropertyMap(), null); modifyHeaderText(legendParamGroup, view.getRaster()); fileChooser.setDialogTitle(SnapApp.getDefault().getInstanceName() + " - export Colour Legend Image"); /*I18N*/ fileChooser.setCurrentFilename(imageBaseName + "_legend"); final RasterDataNode raster = view.getRaster(); imageLegend = new ImageLegend(raster.getImageInfo(), raster); fileChooser.setAccessory(createImageLegendAccessory( fileChooser, legendParamGroup, imageLegend, getHelpCtx().getHelpID())); }