use of org.geotoolkit.factory.Hints in project geotoolkit by Geomatys.
the class ReferencingFactoryContainer method getCurrentHints.
/**
* Returns the hints to be used for lazy creation of <em>default</em> factories in various
* {@code getFoo} methods. At the difference of {@link #getImplementationHints}, this method
* do not force fetching of factories that were not already obtained.
*/
private Hints getCurrentHints() {
final Hints completed = new Hints();
assert Thread.holdsLock(this);
completed.putAll(hints);
declaredFactoryHints(completed);
return completed;
}
use of org.geotoolkit.factory.Hints in project geotoolkit by Geomatys.
the class DisplayElement method setRenderingHint.
/**
* Adds a rendering hint. The default implementation ignore the hint value and does nothing.
* The {@link AbstractCanvas} and other subclasses override this method in order to performs
* real work.
*
* @param key The hint key.
* @param value The hint value. A {@code null} value remove the hint.
*
* @see #setRenderingHint(java.awt.RenderingHints.Key, java.lang.Object)
*/
public void setRenderingHint(final RenderingHints.Key key, final Object value) {
final Hints hints = getHints(true);
hints.put(key, value);
}
use of org.geotoolkit.factory.Hints in project geotoolkit by Geomatys.
the class AbstractFeatureCollection method toArray.
@Override
public <T> T[] toArray(T[] a) {
final List<Object> datas = new ArrayList<>();
final Hints hints = new Hints();
final FeatureIterator ite = iterator(hints);
try {
while (ite.hasNext()) {
datas.add(ite.next());
}
} finally {
ite.close();
}
return datas.toArray(a);
}
use of org.geotoolkit.factory.Hints in project geotoolkit by Geomatys.
the class AbstractFeatureCollection method toArray.
// fix toArray methods to forced separate features
@Override
public Object[] toArray() {
final List<Object> datas = new ArrayList<>();
final Hints hints = new Hints();
final FeatureIterator ite = iterator(hints);
try {
while (ite.hasNext()) {
datas.add(ite.next());
}
} finally {
ite.close();
}
return datas.toArray();
}
use of org.geotoolkit.factory.Hints in project geotoolkit by Geomatys.
the class FeatureSetWrapper method toArray.
@Override
public <T> T[] toArray(T[] a) {
final List<Object> datas = new ArrayList<>();
final Hints hints = new Hints();
final FeatureIterator ite = iterator(hints);
try {
while (ite.hasNext()) {
datas.add(ite.next());
}
} finally {
ite.close();
}
return datas.toArray(a);
}
Aggregations