Class Quicklook
- java.lang.Object
-
- com.bc.ceres.core.ExtensibleObject
-
- org.esa.snap.core.datamodel.ProductNode
-
- org.esa.snap.core.datamodel.quicklooks.Quicklook
-
- All Implemented Interfaces:
Extensible
,Thumbnail
public class Quicklook extends ProductNode implements Thumbnail
Created by luis on 10/01/2016.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.esa.snap.core.datamodel.quicklooks.Thumbnail
Thumbnail.ThumbnailListener
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_QUICKLOOK_NAME
static String
SNAP_QUICKLOOK_FILE_PREFIX
-
Fields inherited from class org.esa.snap.core.datamodel.ProductNode
PROPERTY_NAME_DESCRIPTION, PROPERTY_NAME_NAME
-
Fields inherited from interface org.esa.snap.core.datamodel.quicklooks.Thumbnail
listenerList
-
-
Constructor Summary
Constructors Constructor Description Quicklook(File productFile)
Quicklook(Product product, String name)
Constructor when only a quicklook name is given.Quicklook(Product product, String name, File browseFile)
Constructor when a browseFile is given.Quicklook(Product product, String name, File browseFile, boolean productCanAppendFiles, Path productQuicklookFolder, Band[] quicklookBands)
Constructor when a browseFile is given.Quicklook(Product product, String name, Band[] quicklookBands)
Constructor when a browseFile is given.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
acceptVisitor(ProductVisitor visitor)
Accepts the given visitor.BufferedImage
getImage(ProgressMonitor pm)
File
getProductFile()
long
getRawStorageSize(ProductSubsetDef subsetDef)
Gets an estimated, raw storage size in bytes of this product node.boolean
hasCachedImage()
boolean
hasImage()
boolean
hasProduct()
void
setProduct(Product product)
void
setQuicklookLink(String link)
-
Methods inherited from class org.esa.snap.core.datamodel.ProductNode
dispose, fireProductNodeChanged, fireProductNodeChanged, getDescription, getDisplayName, getName, getOwner, getProduct, getProductReader, getProductReaderSafe, getProductRefString, getProductSafe, getProductWriter, getProductWriterSafe, getRawStorageSize, isModified, isPartOfSubset, isValidNodeName, removeFromFile, setDescription, setModified, setName, setOwner, toString, updateExpression
-
Methods inherited from class com.bc.ceres.core.ExtensibleObject
getExtension
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.esa.snap.core.datamodel.quicklooks.Thumbnail
addListener, getProduct, notifyImageUpdated, removeListener
-
-
-
-
Field Detail
-
DEFAULT_QUICKLOOK_NAME
public static final String DEFAULT_QUICKLOOK_NAME
- See Also:
- Constant Field Values
-
SNAP_QUICKLOOK_FILE_PREFIX
public static final String SNAP_QUICKLOOK_FILE_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Quicklook
public Quicklook(File productFile)
-
Quicklook
public Quicklook(Product product, String name)
Constructor when only a quicklook name is given. Quicklook will be generated using defaults- Parameters:
product
- the source productname
- the name of the quicklook
-
Quicklook
public Quicklook(Product product, String name, File browseFile)
Constructor when a browseFile is given. The quicklook is generated from the browse file- Parameters:
product
- the source productname
- the name of the quicklookbrowseFile
- the preview or browse image from a product
-
Quicklook
public Quicklook(Product product, String name, Band[] quicklookBands)
Constructor when a browseFile is given. The quicklook is generated from the browse file- Parameters:
product
- the source productname
- the name of the quicklookquicklookBands
- the bands to create an RGB quicklook from
-
Quicklook
public Quicklook(Product product, String name, File browseFile, boolean productCanAppendFiles, Path productQuicklookFolder, Band[] quicklookBands)
Constructor when a browseFile is given. The quicklook is generated from the browse file- Parameters:
product
- the source productname
- the name of the quicklookbrowseFile
- the preview or browse image from a productproductCanAppendFiles
- true when files may be written to the productproductQuicklookFolder
- where to write the quicklook files
-
-
Method Detail
-
setProduct
public void setProduct(Product product)
-
hasProduct
public boolean hasProduct()
-
getProductFile
public File getProductFile()
-
getRawStorageSize
public long getRawStorageSize(ProductSubsetDef subsetDef)
Gets an estimated, raw storage size in bytes of this product node.- Specified by:
getRawStorageSize
in classProductNode
- Parameters:
subsetDef
- if notnull
the subset may limit the size returned- Returns:
- the size in bytes.
-
setQuicklookLink
public void setQuicklookLink(String link)
-
acceptVisitor
public void acceptVisitor(ProductVisitor visitor)
Accepts the given visitor. This method implements the well known 'Visitor' design pattern of the gang-of-four. The visitor pattern allows to define new operations on the product data model without the need to add more code to it. The new operation is implemented by the visitor.The method simply calls
visitor.visit(this)
.- Specified by:
acceptVisitor
in classProductNode
- Parameters:
visitor
- the visitor, must not benull
-
hasCachedImage
public boolean hasCachedImage()
- Specified by:
hasCachedImage
in interfaceThumbnail
-
getImage
public BufferedImage getImage(ProgressMonitor pm)
-
-