Package noaa.coastwatch.render
Class HybridView
java.lang.Object
noaa.coastwatch.render.EarthDataView
noaa.coastwatch.render.HybridView
- All Implemented Interfaces:
Cloneable
,Renderable
The HybridView class is an earth data view that combines a set of data views. The hybrid view is a combination of data view layers with masks that control the transparency of each layer.
- Since:
- 3.7.1
- Author:
- Peter Hollemans
-
Field Summary
Fields inherited from class noaa.coastwatch.render.EarthDataView
changed, image, imageDims, overlays, progress, stopRendering, trans, UPDATE_FRACTION, verbose
-
Constructor Summary
ConstructorDescriptionHybridView
(List<EarthDataView> viewList, List<MaskOverlay> maskList) Constructs a new hybrid view. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Creates and returns a copy of this object.Gets a legend for annotation of the data view.void
Invalidates the view.protected void
Prepares this view for rendering using the specified graphics object.void
reset()
Resets the view to the full data resolution.void
resize
(double factor) Changes the view size by the specified factor.void
setCenter
(DataLocation center) Sets the view center to a new data location.void
setCenterAndScale
(DataLocation center, double scale) Set the center and scale of this viewvoid
setImageAffine
(AffineTransform affine) Sets the image affine transform.void
Sets the view to a new size.void
setVerbose
(boolean flag) Sets the verbose mode flag.Methods inherited from class noaa.coastwatch.render.EarthDataView
addOverlay, addOverlays, computeCaches, containsOverlay, getArea, getBounds, getCenter, getCorners, getImageAffine, getOrientationAffine, getOverlays, getProgress, getResolution, getScale, getSize, getSubregion, getTransform, getUpsideDown, hasCompatibleCaches, hasCoordinateCaches, isChanged, isPrepared, isRendering, magnify, magnify, magnify, main, removeOverlay, render, resize, resizeHeight, resizeMaxAspect, resizeWidth, setChanged, setProgress, setProperties, showSubregion, stopRendering, transform, transform
-
Constructor Details
-
HybridView
Constructs a new hybrid view.- Parameters:
viewList
- the list of views to create a hybrid. The views are composited starting with index 0.maskList
- the list of mask overlays that determine which of the view pixels should be used in the hybrid. If a mask overlay pixel is active, the corresponding view pixel is made transparent. If a mask overlay is null, the image view is not masked.
-
-
Method Details
-
setImageAffine
Description copied from class:EarthDataView
Sets the image affine transform. When the view is rendered, the new image affine will be used to transform the image coordinates prior to rendering. Any overlays rendered will be unaffected.- Overrides:
setImageAffine
in classEarthDataView
- Parameters:
affine
- the image affine transform, or null for no transform.
-
setVerbose
public void setVerbose(boolean flag) Description copied from class:EarthDataView
Sets the verbose mode flag.- Overrides:
setVerbose
in classEarthDataView
-
invalidate
public void invalidate()Description copied from class:EarthDataView
Invalidates the view. This causes the view to be completely reconstructed upon the next call torender()
.- Overrides:
invalidate
in classEarthDataView
-
setCenter
Description copied from class:EarthDataView
Sets the view center to a new data location. The image dimensions and image scaling factor are unaffected.- Overrides:
setCenter
in classEarthDataView
- Parameters:
center
- the new center data location.- Throws:
NoninvertibleTransformException
- if the image to data transform is not invertible.
-
setCenterAndScale
public void setCenterAndScale(DataLocation center, double scale) throws NoninvertibleTransformException Description copied from class:EarthDataView
Set the center and scale of this view- Overrides:
setCenterAndScale
in classEarthDataView
- Parameters:
center
- the new center data location.scale
- the new scaling factor for the view (desired ratio of data pixels to image pixels).- Throws:
NoninvertibleTransformException
- See Also:
-
resize
Description copied from class:EarthDataView
Changes the view size by the specified factor. The view dimensions are changed, as well as the data to image scaling so that the same data is displayed in the resized view. The center data location is unaffected.- Overrides:
resize
in classEarthDataView
- Parameters:
factor
- the factor by which to change the view size. Factors greater than 1 increase the view size and factors less than 1 decrease the view size.- Throws:
NoninvertibleTransformException
- if the image to data transform is not invertible.
-
reset
Description copied from class:EarthDataView
Resets the view to the full data resolution. The center data location is reset to the center of the data, the image:data scaling factor to 1, and the image dimensions to the full data dimensions.- Overrides:
reset
in classEarthDataView
- Throws:
NoninvertibleTransformException
- if the image to data transform is not invertible.
-
setSize
Description copied from class:EarthDataView
Sets the view to a new size. The data center location and image scaling factor remain unaffected.- Overrides:
setSize
in classEarthDataView
- Parameters:
imageDims
- the new image dimensions.- Throws:
NoninvertibleTransformException
- if the image to data transform is not invertible.
-
getLegend
Description copied from class:EarthDataView
Gets a legend for annotation of the data view. This default method returns null, but subclasses may override this method to provide a legend.- Overrides:
getLegend
in classEarthDataView
- Returns:
- a legend or null if no legend is available.
-
clone
Description copied from class:EarthDataView
Creates and returns a copy of this object. Child classes should override this method if they contain any deep structure that needs copying.- Overrides:
clone
in classEarthDataView
-
prepare
Description copied from class:EarthDataView
Prepares this view for rendering using the specified graphics object. This method is called when any changes have occurred that require the view to be completely reconstructed, such as a change in view size or data window.- Specified by:
prepare
in classEarthDataView
-