net.refractions.udig.project.render
Interface IRenderMetrics

All Known Implementing Classes:
AbstractRenderMetrics

public interface IRenderMetrics

A RenderMetrics object is used to calculate estimated metrics for a renderer while rendering a particular layer. RenderMetrics objects are used to decide which renderer to instantiate to render a layer. As the state of udig changes different renderers may be more suited so the RenderMetrics object are also used to judge whether a new renderer should be used for rendering a layer.

Version:
$Revision: 1.9 $
Author:
Jesse Eichar
See Also:
AbstractRenderMetrics

Method Summary
 boolean canAddLayer(ILayer layer)
          Check to see if this layers can be added to rendered.
 boolean canStyle(java.lang.String styleID, java.lang.Object value)
          True if renderer use the provided style information.
 Renderer createRenderer()
          Creates a new Renderer that is represented by this Metrics object
 IRenderContext getRenderContext()
           
 IRenderMetricsFactory getRenderMetricsFactory()
          Returns the IRenderMetricsFactory that created this object.
 java.util.Set<javax.media.jai.util.Range> getValidScaleRanges()
          Returns a set of valid ranges of doubles that indicates the scales that the layer is valid.
 boolean isOptimized()
          Returns true if this renderer is built specifically to render the GeoResource.
 

Method Detail

createRenderer

Renderer createRenderer()
Creates a new Renderer that is represented by this Metrics object

Returns:
a new Renderer that is represented by this Metrics object

getRenderContext

IRenderContext getRenderContext()
Returns:
the RenderContext that this RenderMetrics is valid for.
See Also:
IRenderContext

getRenderMetricsFactory

IRenderMetricsFactory getRenderMetricsFactory()
Returns the IRenderMetricsFactory that created this object.

Returns:
the IRenderMetricsFactory that created this object.
See Also:
IRenderMetricsFactory

canStyle

boolean canStyle(java.lang.String styleID,
                 java.lang.Object value)
True if renderer use the provided style information.

The style information should be considered with respect to the current getRenderContext().

Parameters:
SyleID -
value -
Returns:
true if renderer can use the provided style information

getValidScaleRanges

java.util.Set<javax.media.jai.util.Range> getValidScaleRanges()
Returns a set of valid ranges of doubles that indicates the scales that the layer is valid. This is based on restrictions inherent in the IGeoResource. For example WMS layers have a valid min and max scale. Other parameters such as the style can also affect the range of valid scales.

The value of a RenderMetrics with a scale that is within the Viewport's scale will be increased. an empty set is return then this will be disregarded

Returns:
a set of valid ranges of doublesthat indicates the scales that the layer is valid

isOptimized

boolean isOptimized()
Returns true if this renderer is built specifically to render the GeoResource.

Returns:
true if renderer is optimized to render

canAddLayer

boolean canAddLayer(ILayer layer)
Check to see if this layers can be added to rendered.

This is only called for renderers that are MultiLayer renderers.