Search in sources :

Example 11 with Hints

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;
}
Also used : Hints(org.geotoolkit.factory.Hints) RenderingHints(java.awt.RenderingHints)

Example 12 with Hints

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);
}
Also used : Hints(org.geotoolkit.factory.Hints) RenderingHints(java.awt.RenderingHints)

Example 13 with Hints

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);
}
Also used : Hints(org.geotoolkit.factory.Hints) ArrayList(java.util.ArrayList)

Example 14 with Hints

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();
}
Also used : Hints(org.geotoolkit.factory.Hints) ArrayList(java.util.ArrayList)

Example 15 with Hints

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);
}
Also used : WrapFeatureIterator(org.geotoolkit.storage.memory.WrapFeatureIterator) Hints(org.geotoolkit.factory.Hints) ArrayList(java.util.ArrayList)

Aggregations

Hints (org.geotoolkit.factory.Hints)30 RenderingHints (java.awt.RenderingHints)10 DataStoreException (org.apache.sis.storage.DataStoreException)10 GO2Hints (org.geotoolkit.display2d.GO2Hints)10 Dimension (java.awt.Dimension)9 MapLayers (org.apache.sis.portrayal.MapLayers)9 Test (org.junit.Test)9 BufferedImage (java.awt.image.BufferedImage)8 FeatureType (org.opengis.feature.FeatureType)8 IOException (java.io.IOException)7 ArrayList (java.util.ArrayList)7 GeneralEnvelope (org.apache.sis.geometry.GeneralEnvelope)7 Filter (org.opengis.filter.Filter)7 CoordinateReferenceSystem (org.opengis.referencing.crs.CoordinateReferenceSystem)7 MapLayer (org.apache.sis.portrayal.MapLayer)6 PortrayalException (org.geotoolkit.display.PortrayalException)6 CanvasDef (org.geotoolkit.display2d.service.CanvasDef)6 SceneDef (org.geotoolkit.display2d.service.SceneDef)6 Query (org.apache.sis.storage.Query)5 FeatureReader (org.geotoolkit.storage.feature.FeatureReader)5