com.bbn.openmap.image
Class AcmeGifFormatter

java.lang.Object
  extended by com.bbn.openmap.image.AbstractImageFormatter
      extended by com.bbn.openmap.image.AcmeGifFormatter
All Implemented Interfaces:
ImageFormatter, PropertyConsumer, java.beans.PropertyChangeListener, java.util.EventListener

public class AcmeGifFormatter
extends AbstractImageFormatter

This formatter requires the Acme.JPM.Encoders package. That code can be found at http://www.acme.com/java .


Field Summary
 
Fields inherited from class com.bbn.openmap.image.AbstractImageFormatter
bufferedImage, layers, propertiesPrefix
 
Fields inherited from interface com.bbn.openmap.PropertyConsumer
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
 
Constructor Summary
AcmeGifFormatter()
           
 
Method Summary
 byte[] formatImage(java.awt.image.BufferedImage bi)
          Convert a BufferedImage to a image file format...
 java.lang.String getContentType()
          Get the Mime Content Type created by the ImageFormatter.
 java.lang.String getFormatLabel()
          Get the Image Type created by the ImageFormatter.
 java.awt.Graphics getGraphics(int width, int height)
          Return the applicable Graphics to use to paint the layers into.
protected  boolean imageFormatSupportAlphaChannel()
          Return true if the image format support alpha channel.
protected  boolean imageFormatSupportTransparentPixel()
          Return true if the image format support fully transparent pixels.
 ImageFormatter makeClone()
          Create a new instance of the same type of formatter.
 void setProperties(java.lang.String prefix, java.util.Properties props)
          Set the properties of the image formatter.
 
Methods inherited from class com.bbn.openmap.image.AbstractImageFormatter
getBufferedImage, getGraphics, getGraphics, getImageBytes, getImageFromMapBean, getImageFromMapBean, getImageFromMapBean, getProperties, getPropertyInfo, getPropertyPrefix, getScaledBufferedImage, getScaledImageBytes, propertyChange, setBufferedImage, setProperties, setPropertyPrefix
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AcmeGifFormatter

public AcmeGifFormatter()
Method Detail

setProperties

public void setProperties(java.lang.String prefix,
                          java.util.Properties props)
Description copied from class: AbstractImageFormatter
Set the properties of the image formatter.

Specified by:
setProperties in interface ImageFormatter
Specified by:
setProperties in interface PropertyConsumer
Overrides:
setProperties in class AbstractImageFormatter
Parameters:
prefix - a String used by the PropertyConsumer to prepend to each property value it wants to look up - setList.getProperty(prefix.propertyKey). If the prefix had already been set, then the prefix passed in should replace that previous value.
props - a Properties object that the PropertyConsumer can use to retrieve expected properties it can use for configuration.

makeClone

public ImageFormatter makeClone()
Description copied from class: AbstractImageFormatter
Create a new instance of the same type of formatter. If you are running in a multi-threaded environment, you'll need to provide a new instance of the formatter to each thread, since the image and graphics that are being drawn into for each thread are contained within.

Specified by:
makeClone in interface ImageFormatter
Specified by:
makeClone in class AbstractImageFormatter
Returns:
a new instance of this type of formatter, with the same properties set.

formatImage

public byte[] formatImage(java.awt.image.BufferedImage bi)
Description copied from class: AbstractImageFormatter
Convert a BufferedImage to a image file format...

Specified by:
formatImage in interface ImageFormatter
Specified by:
formatImage in class AbstractImageFormatter
Parameters:
bi - a BufferedImage..

getFormatLabel

public java.lang.String getFormatLabel()
Get the Image Type created by the ImageFormatter. These responses should adhere to the OGC WMT standard format labels. Some are listed in the WMTConstants interface file.


getGraphics

public java.awt.Graphics getGraphics(int width,
                                     int height)
Return the applicable Graphics to use to paint the layers into. If the internal BufferedImage hasn't been created yet, or has been set to null, then a new buffered Image is created, set to the size specified by the height and width. The ImageGenerator extends MapBean. Remember to dispose of the graphics object when you are done with it. Uses the BufferedImage.TYPE_INT_ARGB colormodel.

Specified by:
getGraphics in interface ImageFormatter
Overrides:
getGraphics in class AbstractImageFormatter
Parameters:
width - pixel width of Graphics.
height - pixel height of Graphics.
Returns:
java.awt.Graphics object to use.
See Also:
BufferedImage

getContentType

public java.lang.String getContentType()
Description copied from interface: ImageFormatter
Get the Mime Content Type created by the ImageFormatter.


imageFormatSupportAlphaChannel

protected boolean imageFormatSupportAlphaChannel()
Description copied from class: AbstractImageFormatter
Return true if the image format support alpha channel. The returned value represent the capability of the image format, not the current color model.

Specified by:
imageFormatSupportAlphaChannel in class AbstractImageFormatter
Returns:
true if alpha supported

imageFormatSupportTransparentPixel

protected boolean imageFormatSupportTransparentPixel()
Description copied from class: AbstractImageFormatter
Return true if the image format support fully transparent pixels. The returned value represent the capability of the image format, not the current color model.

Specified by:
imageFormatSupportTransparentPixel in class AbstractImageFormatter
Returns:
true of transparent pixels supported


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details