org.hd.d.pg2k.svrCore.mediahandler
Class swf

java.lang.Object
  extended by org.hd.d.pg2k.svrCore.MIME.AbstractHandler
      extended by org.hd.d.pg2k.svrCore.mediahandler.swf
All Implemented Interfaces:
Handler

public final class swf
extends AbstractHandler

Basic handler for SWF file (MacroMedia Shockwave Flash).


Nested Class Summary
static class swf.SWFMetaData
          Immutable meta-data for SWF exhibit.
 
Nested classes/interfaces inherited from interface org.hd.d.pg2k.svrCore.MIME.Handler
Handler.ThumbnailParams
 
Field Summary
private static int TWIPS_TO_PIXELS
          TWIPS to pixels scaling factor assuming 72dpi screen resolution.
 
Fields inherited from interface org.hd.d.pg2k.svrCore.MIME.Handler
TAG_NAME_METADATA_TOP
 
Constructor Summary
swf()
           
 
Method Summary
 java.awt.Dimension get2DImageDimensions(java.io.InputStream is)
          Efficiently get X,Y pixel dimensions of SWF exhibit, else null if dimensions cannot be computed.
 ExhibitMIME.ExhibitTypeParameters getExhibitType()
          Get internal type of ExhibitMIME type; never null.
 org.w3c.dom.Node getMetadata(java.io.InputStream is, Name.ExhibitFull exhibitName)
          Gets all available exhibit metadata as a single XML DOM tree; null if none.
 
Methods inherited from class org.hd.d.pg2k.svrCore.MIME.AbstractHandler
canMakeThumbnails, decodeImage, getThumbnailParams, makeImageBinary, makeSizeConstrainedEncodedImage, makeThumbnails, makeThumbnails
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TWIPS_TO_PIXELS

private static final int TWIPS_TO_PIXELS
TWIPS to pixels scaling factor assuming 72dpi screen resolution.

See Also:
Constant Field Values
Constructor Detail

swf

public swf()
Method Detail

getExhibitType

public ExhibitMIME.ExhibitTypeParameters getExhibitType()
Get internal type of ExhibitMIME type; never null.


get2DImageDimensions

public java.awt.Dimension get2DImageDimensions(java.io.InputStream is)
                                        throws java.io.IOException
Efficiently get X,Y pixel dimensions of SWF exhibit, else null if dimensions cannot be computed. This does not close its input stream when done.

This should work efficiently, by directly reading (opening) bytes of the exhibit passed as an input stream.

This will only work correctly if the exhibit is of the correct type, eg its magic number must already have been tested.

Specified by:
get2DImageDimensions in interface Handler
Overrides:
get2DImageDimensions in class AbstractHandler
Parameters:
is - the exhibit as a binary data stream
Throws:
java.io.IOException - in case of problems with corrupt data (or a broken exhibit)

getMetadata

public org.w3c.dom.Node getMetadata(java.io.InputStream is,
                                    Name.ExhibitFull exhibitName)
Gets all available exhibit metadata as a single XML DOM tree; null if none. We do not (yet) have a schema for this and may never do so, since its structure and content will depend on various external sources and parts of (for example) the ImageIO and JAI subsystems.

This implementation synthesises a metadata tree from the AudioFileFormat data, if any.

Specified by:
getMetadata in interface Handler
Overrides:
getMetadata in class AbstractHandler
Parameters:
is - input stream; never null
exhibitName - TODO
Returns:
top-level node "metadata" with captured metadata beneath, else null

DHD Multimedia Gallery V1.57.21

Copyright (c) 1996-2011, Damon Hart-Davis. All rights reserved.