Refine search
/** * Constructs a new sample dimension with the same categories and * units than the specified sample dimension. * * @param other The other sample dimension, or {@code null}. */ protected GridSampleDimension(final GridSampleDimension other) { if (other != null) { inverse = other.inverse; categories = other.categories; isGeophysics = other.isGeophysics; hasQualitative = other.hasQualitative; hasQuantitative = other.hasQuantitative; sampleToGeophysics = other.sampleToGeophysics; description = other.description; } else { // 'inverse' will be set when needed. categories = null; isGeophysics = false; hasQualitative = false; hasQuantitative = false; sampleToGeophysics = null; description = Vocabulary.formatInternational(VocabularyKeys.UNTITLED); } }
/** Returns the name in the specified locale. */ public String toString(final Locale locale) { final StringBuffer buffer = new StringBuffer(30); if (main != null) { buffer.append(main.getName().toString(locale)); } else { buffer.append('('); buffer.append(Vocabulary.getResources(locale).getString(VocabularyKeys.UNTITLED)); buffer.append(')'); } buffer.append(' '); return String.valueOf(geophysics(true).formatRange(buffer, locale)); }
/** * Gets a string for the given key from this resource bundle or one of its parents. * * @param key The key for the desired string. * @return The string for the given key. * @throws MissingResourceException If no object for the given key can be found. */ public static String format(final int key) throws MissingResourceException { return getResources(null).getString(key); }
/** * Returns the coverage name in the specified locale. */ private static String getName(final Coverage coverage, final Locale locale) { if (coverage instanceof AbstractCoverage) { final InternationalString name = ((AbstractCoverage) coverage).getName(); if (name != null) { return name.toString(locale); } } return Vocabulary.getResources(locale).getString(VocabularyKeys.UNTITLED); }
InternationalString noDataName = Vocabulary.formatInternational(VocabularyKeys.NODATA); Object objNoData = srcCoverage.getProperty(noDataName.toString()); if (objNoData != null && objNoData instanceof Number) { return (Double) objNoData;
description = Vocabulary.formatInternational(VocabularyKeys.UNTITLED); categoryList.add(new Category(name, colors, range, (MathTransform1D) null)); categoryList.add(new Category(name, colors, range, (MathTransform1D) null)); lower = upper; for (int i = categoryList.size(); --i >= 0;) { Category category = (Category) categoryList.get(i); if (!category.isQuantitative()) { final NumberRange range = category.getRange(); final Comparable min = range.getMinValue();
new Category( Vocabulary.formatInternational(VocabularyKeys.NORMAL), (Color) null, NumberRange.create(minimum, maximum)),} new Category( Vocabulary.formatInternational(VocabularyKeys.NODATA), new Color(0, 0, 0, 0), NumberRange.create(nodata, nodata))} this.type = type; this.color = color; bkg = new Category("Background", TRANSPARENT, 0);
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; }
Category valuesCat = new Category("values", colorRange, sampleValueRange, LinearTransform1D.IDENTITY).geophysics(geophysics); Category nodataCat = new Category( Vocabulary.formatInternational(VocabularyKeys.NODATA), transparent, noDataValue); categories = new Category[] { valuesCat, nodataCat };
/** * Returns the column name for the given index. */ public String getColumnName(final int column) { final int key; switch (column) { case 0: key=VocabularyKeys.NAME; break; case 1: key=VocabularyKeys.VALUE; break; default: throw new IndexOutOfBoundsException(String.valueOf(column)); } return resources.getString(key); }
this.description = list.getName(); } else { this.description = Vocabulary.formatInternational(VocabularyKeys.UNTITLED); if (list != null) { for (int i=list.size(); --i >= 0;) { final MathTransform1D candidate = list.get(i).getSampleToGeophysics(); if (candidate == null) { qualitative = true;
Arrays.fill(areaBounds, new Double(Double.NaN)); final Vocabulary resources = Vocabulary.getResources(null); final LogRecord record = resources.getLogRecord(Level.FINER, VocabularyKeys.RECTANGLE_$4, areaBounds); record.setSourceClassName (className);
/** * Construct an editor for value using the specified format. */ public Singleton(final Format format) { super(new GridBagLayout()); if (format != null) { field = new JFormattedTextField(format); } else { field = new JTextField(); } field.setEditable(editable); final Vocabulary resources = Vocabulary.getResources(getLocale()); final GridBagConstraints c = new GridBagConstraints(); c.gridx=0; c.gridwidth=1; c.insets.left=9; c.fill=c.HORIZONTAL; c.gridy=0; add(new JLabel(resources.getLabel(VocabularyKeys.TYPE )), c); c.gridy++; add(new JLabel(resources.getLabel(VocabularyKeys.MINIMUM)), c); c.gridy++; add(new JLabel(resources.getLabel(VocabularyKeys.MAXIMUM)), c); c.gridy++; add(new JLabel(resources.getLabel(VocabularyKeys.VALUE )), c); c.gridx=1; c.weightx=1; c.insets.right=9; c.gridy=0; add(type, c); c.gridy++; add(minimum, c); c.gridy++; add(maximum, c); c.gridy++; add(field, c); }
/** * Returns the resources for the widget locale. */ final Vocabulary getResources() { Locale locale; try { locale = getLocale(); } catch (IllegalComponentStateException exception) { locale = getDefaultLocale(); } return Vocabulary.getResources(locale); }
/** * Returns resources in the given locale. * * @param locale The locale, or {@code null} for the default locale. * @return Resources in the given locale. * @throws MissingResourceException if resources can't be found. */ public static Vocabulary getResources(Locale locale) throws MissingResourceException { if (locale == null) { locale = Locale.getDefault(); } return (Vocabulary) getBundle(Vocabulary.class.getName(), locale); /* * We rely on cache capability of ResourceBundle. */ }
/** * Returns the coverage name in the specified locale. */ private static String getName(final Coverage coverage, final Locale locale) { if (coverage instanceof AbstractCoverage) { return ((AbstractCoverage) coverage).getName().toString(locale); } else { return Vocabulary.getResources(locale).getString(VocabularyKeys.UNTITLED); } }
description = Vocabulary.formatInternational(VocabularyKeys.UNTITLED); categoryList.add(new Category(name, colors, range, (MathTransform1D) null)); categoryList.add(new Category(name, colors, range, (MathTransform1D) null)); lower = upper; for (int i = categoryList.size(); --i >= 0;) { Category category = categoryList.get(i); if (!category.isQuantitative()) { final NumberRange range = category.getRange(); final Comparable min = range.getMinValue();
/** * Gets a string for the given key from this resource bundle or one of its parents. * * @param key The key for the desired string. * @return The string for the given key. * @throws MissingResourceException If no object for the given key can be found. */ public static String format(final int key) throws MissingResourceException { return getResources(null).getString(key); }
public SimplifiedGridSampleDimension( CharSequence description, SampleDimensionType type, ColorInterpretation color, double nodata, double minimum, double maximum, double scale, double offset, Unit<?> unit) { super(description,!Double.isNaN(nodata)? new Category[]{new Category(Vocabulary .formatInternational(VocabularyKeys.NODATA), new Color[]{new Color(0, 0, 0, 0)} , NumberRange .create(nodata, nodata), NumberRange .create(nodata, nodata))}:null,unit); this.nodata=nodata; this.minimum=minimum; this.maximum=maximum; this.scale=scale; this.offset=offset; this.unit=unit; this.type=type; this.color=color; this.bkg=new Category("Background", Utils.TRANSPARENT, 0); }