/** * Returns the name of the column at {@code columnIndex}. */ public String getColumnName(final int columnIndex) { return Vocabulary.format(columnNames[columnIndex]); }
/** * Sets an error message to display instead of the current identified object. * * @param message The error message. */ private void setErrorMessage(final String message) { wktArea.setText(Vocabulary.format(VocabularyKeys.ERROR_$1, message)); } }
/** * Sets an error message to display instead of the current identified object. * * @param message The error message. */ public void setErrorMessage(final String message) { wktArea.setText(Vocabulary.format(VocabularyKeys.ERROR_$1, message)); } }
/** * Sets an error message to display instead of the current identified object. * * @param message The error message. */ private void setErrorMessage(final String message) { wktArea.setText(Vocabulary.format(VocabularyKeys.ERROR_$1, message)); }
/** * Sets an error message to display instead of the current identified object. * * @param message The error message. */ private void setErrorMessage(final String message) { wktArea.setText(Vocabulary.format(VocabularyKeys.ERROR_$1, message)); }
/** * Gets an international string for the given key. This method does not check for the key * validity. If the key is invalid, then a {@link MissingResourceException} may be thrown * when a {@link InternationalString#toString} method is invoked. * * @param key The key for the desired string. * @param arg0 Value to substitute to "{0}". * @return An international string for the given key. * * @todo Current implementation just invokes {@link #format}. Need to format only when * {@code toString(Locale)} is invoked. */ public static InternationalString formatInternational(final int key, final Object arg0) { return new org.geotools.util.SimpleInternationalString(format(key, arg0)); }
/** * Gets an international string for the given key. This method does not check for the key * validity. If the key is invalid, then a {@link MissingResourceException} may be thrown * when a {@link InternationalString#toString} method is invoked. * * @param key The key for the desired string. * @param arg0 Value to substitute to "{0}". * @return An international string for the given key. * * @todo Current implementation just invokes {@link #format}. Need to format only when * {@code toString(Locale)} is invoked. */ public static InternationalString formatInternational(final int key, final Object arg0) { return new org.geotools.util.SimpleInternationalString(format(key, arg0)); }
/** * Gets an international string for the given key. This method does not check for the key * validity. If the key is invalid, then a {@link MissingResourceException} may be thrown * when a {@link InternationalString#toString} method is invoked. * * @param key The key for the desired string. * @param arg0 Value to substitute to "{0}". * @param arg1 Value to substitute to "{1}". * @return An international string for the given key. * * @todo Current implementation just invokes {@link #format}. Need to format only when * {@code toString(Locale)} is invoked. */ public static InternationalString formatInternational(final int key, final Object arg0, final Object arg1) { return new org.geotools.util.SimpleInternationalString(format(key, arg0, arg1)); }
/** * Gets an international string for the given key. This method does not check for the key * validity. If the key is invalid, then a {@link MissingResourceException} may be thrown * when a {@link InternationalString#toString} method is invoked. * * @param key The key for the desired string. * @param arg0 Value to substitute to "{0}". * @param arg1 Value to substitute to "{1}". * @return An international string for the given key. * * @todo Current implementation just invokes {@link #format}. Need to format only when * {@code toString(Locale)} is invoked. */ public static InternationalString formatInternational(final int key, final Object arg0, final Object arg1) { return new org.geotools.util.SimpleInternationalString(format(key, arg0, arg1)); }
/** * Prints an exception stack trace in a box. */ public synchronized void exceptionOccurred(final Throwable exception) { carriageReturn(0); printInBox(Vocabulary.format(VocabularyKeys.EXCEPTION)); exception.printStackTrace(out); hasPrintedWarning = false; out.flush(); }
/** * Gets an international string for the given key. This method does not check for the key * validity. If the key is invalid, then a {@link MissingResourceException} may be thrown * when a {@link InternationalString#toString} method is invoked. * * @param key The key for the desired string. * @param arg0 Value to substitute to "{0}". * @param arg1 Value to substitute to "{1}". * @param arg2 Value to substitute to "{2}". * @return An international string for the given key. * * @todo Current implementation just invokes {@link #format}. Need to format only when * {@code toString(Locale)} is invoked. */ public static InternationalString formatInternational(final int key, final Object arg0, final Object arg1, final Object arg2) { return new org.geotools.util.SimpleInternationalString(format(key, arg0, arg1, arg2)); }
/** * Prints a summary of the specified exception, without stack trace. This method * is invoked when a non-fatal (and somewhat expected) error occured, for example * {@link java.io.FileNotFoundException} when the file were specified in argument. * * @param exception An exception with a message describing the user's error. * * @since 2.3 */ public void printSummary(final Exception exception) { final String type = Utilities.getShortClassName(exception); String message = exception.getLocalizedMessage(); if (message == null) { message = Vocabulary.format(VocabularyKeys.NO_DETAILS_$1, type); } else { err.print(type); err.print(": "); } err.println(message); err.flush(); }
/** * Prints a summary of the specified exception, without stack trace. This method * is invoked when a non-fatal (and somewhat expected) error occured, for example * {@link java.io.FileNotFoundException} when the file were specified in argument. * * @param exception An exception with a message describing the user's error. * * @since 2.3 */ public void printSummary(final Exception exception) { final String type = Classes.getShortClassName(exception); String message = exception.getLocalizedMessage(); if (message == null) { message = Vocabulary.format(VocabularyKeys.NO_DETAILS_$1, type); } else { err.print(type); err.print(": "); } err.println(message); err.flush(); }
private void setIdentifiedObject(final IdentifiedObject item) { String text; try { text = item.toWKT(); } catch (UnsupportedOperationException e) { text = e.getLocalizedMessage(); if (text == null) { text = Classes.getShortClassName(e); } final String lineSeparator = System.getProperty("line.separator", "\n"); if (e instanceof UnformattableObjectException) { text = Vocabulary.format(VocabularyKeys.WARNING) + ": " + text + lineSeparator + lineSeparator + item + lineSeparator; } else { text = Vocabulary.format(VocabularyKeys.ERROR) + ": " + text + lineSeparator; } } wktArea.setText(text); }
private void setIdentifiedObject(final IdentifiedObject item) { String text; try { text = item.toWKT(); } catch (UnsupportedOperationException e) { text = e.getLocalizedMessage(); if (text == null) { text = Classes.getShortClassName(e); } final String lineSeparator = System.getProperty("line.separator", "\n"); if (e instanceof UnformattableObjectException) { text = Vocabulary.format(VocabularyKeys.WARNING) + ": " + text + lineSeparator + lineSeparator + item + lineSeparator; } else { text = Vocabulary.format(VocabularyKeys.ERROR) + ": " + text + lineSeparator; } } wktArea.setText(text); }
static double getCandidateNoData(GridCoverage2D gc) { // no data management final GridSampleDimension sd = (GridSampleDimension) gc .getSampleDimension(0); final List<Category> categories = sd.getCategories(); final Iterator<Category> it = categories.iterator(); Category candidate; double inNoData = Double.NaN; final String noDataName = Vocabulary.format(VocabularyKeys.NODATA); while (it.hasNext()) { candidate = (Category) it.next(); final String name = candidate.getName().toString(); if (name.equalsIgnoreCase("No Data") || name.equalsIgnoreCase(noDataName)) { inNoData = candidate.getRange().getMaximum(); } } return inNoData; }
static double getCandidateNoData(GridCoverage2D gc) { // no data management final GridSampleDimension sd = (GridSampleDimension) gc .getSampleDimension(0); final List categories = sd.getCategories(); final Iterator it = categories.iterator(); Category candidate; double inNoData = Double.NaN; final String noDataName = Vocabulary.format(VocabularyKeys.NODATA); while (it.hasNext()) { candidate = (Category) it.next(); final String name = candidate.getName().toString(); if (name.equalsIgnoreCase("No Data") || name.equalsIgnoreCase(noDataName)) { inNoData = candidate.getRange().getMaximum(); } } return inNoData; }
static double getCandidateNoData(GridCoverage gc) { // no data management final GridSampleDimension sd = (GridSampleDimension) gc .getSampleDimension(0); final List<Category> categories = sd.getCategories(); double inNoData = Double.NaN; if (categories != null) { Category candidate; final String noDataName = Vocabulary.format(VocabularyKeys.NODATA); for (Category category : categories) { candidate = category; final String name = candidate.getName().toString(); if (name.equalsIgnoreCase("No Data") || name.equalsIgnoreCase(noDataName)) { inNoData = candidate.getRange().getMaximum(); break; } } } return inNoData; } }
/** * Set the type and the range of valid values. */ public void setValueRange(Class classe, final Range range) { String type = null; String minimum = null; String maximum = null; if (classe != null) { while (classe.isArray()) { classe = classe.getComponentType(); } classe = XMath.primitiveToWrapper(classe); boolean isInteger = false; if (XMath.isReal(classe) || (isInteger=XMath.isInteger(classe))==true) { type = Vocabulary.format(isInteger ? VocabularyKeys.SIGNED_INTEGER_$1 : VocabularyKeys.REAL_NUMBER_$1, new Integer(XMath.getBitCount(classe))); } else { type = Utilities.getShortName(classe); } } if (range != null) { minimum = format(range.getMinValue()); maximum = format(range.getMaxValue()); } this.type .setText(type); this.minimum.setText(minimum); this.maximum.setText(maximum); }