Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.dinopolis.gpstool.plugin.writerasterimage
Class WriteRasterImagePlugin  view WriteRasterImagePlugin download WriteRasterImagePlugin.java

java.lang.Object
  extended byorg.dinopolis.gpstool.plugin.writerasterimage.WriteRasterImagePlugin
All Implemented Interfaces:
org.dinopolis.gpstool.plugin.Plugin, org.dinopolis.gpstool.plugin.WriteImagePlugin
Direct Known Subclasses:
WriteJpgImagePlugin, WritePngImagePlugin

public abstract class WriteRasterImagePlugin
extends java.lang.Object
implements org.dinopolis.gpstool.plugin.WriteImagePlugin

This plugin writes the content of a component as a raster image format to a stream. It therefore may be used to store a screenshot in a file or to view the content of the window in a dynamic webpage. It uses the javax.imageio.ImageIO class.

Version:
$Revision: 1.2 $

Constructor Summary
WriteRasterImagePlugin()
           
 
Method Summary
static java.awt.image.BufferedImage getComponentScreenShot(java.awt.Component component)
          Returns an image of the component.
 java.lang.String getContentDescription()
          Returns a short description of the content that may be used e.g.
 java.lang.String[] getContentFileExtensions()
          Returns possible file extensions the the content.
 java.lang.String getContentType()
          Returns the content type of the data the plugin produces (e.g.
protected abstract  java.lang.String getImageFormat()
          Returns the format of the images in the form of the javax.imageio.ImageIO.write() method.
 java.lang.String getPluginDescription()
          Returns a description of the Plugin.
 java.lang.String getPluginIdentifier()
          Returns the unique id of the plugin.
 java.lang.String getPluginName()
          Returns the name of the Plugin.
 float getPluginVersion()
          Returns the version of the plugin.
 void initializePlugin(org.dinopolis.gpstool.plugin.PluginSupport support)
          Initialize the plugin and pass a PluginSupport that provides objects, the plugin may use.
 void startPlugin()
          The application calls this method to indicate that the plugin is activated and will be used from now on.
 void stopPlugin()
          The application calls this method to indicate that the plugin is deactivated and will not be used any more.
 void write(java.awt.Component component, java.io.OutputStream out)
          Writes the data to the given output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WriteRasterImagePlugin

public WriteRasterImagePlugin()
Method Detail

initializePlugin

public void initializePlugin(org.dinopolis.gpstool.plugin.PluginSupport support)
Initialize the plugin and pass a PluginSupport that provides objects, the plugin may use.

Specified by:
initializePlugin in interface org.dinopolis.gpstool.plugin.Plugin

startPlugin

public void startPlugin()
                 throws java.lang.Exception
The application calls this method to indicate that the plugin is activated and will be used from now on. The Plugin should initialize any needed resources (files, etc.) in this method.

Specified by:
startPlugin in interface org.dinopolis.gpstool.plugin.Plugin

stopPlugin

public void stopPlugin()
                throws java.lang.Exception
The application calls this method to indicate that the plugin is deactivated and will not be used any more. The Plugin should release all resources (close files, etc.) in this method.

Specified by:
stopPlugin in interface org.dinopolis.gpstool.plugin.Plugin

getPluginIdentifier

public java.lang.String getPluginIdentifier()
Returns the unique id of the plugin. The id is used to identify the plugin and to distinguish it from other plugins.

Specified by:
getPluginIdentifier in interface org.dinopolis.gpstool.plugin.Plugin

getPluginVersion

public float getPluginVersion()
Returns the version of the plugin. The version may be used to choose between different version of the same plugin.

Specified by:
getPluginVersion in interface org.dinopolis.gpstool.plugin.Plugin

getPluginName

public java.lang.String getPluginName()
Returns the name of the Plugin. The name should be a human readable and understandable name like "Save Image as JPEG". It is prefereable but not necessary that the name is localized.

Specified by:
getPluginName in interface org.dinopolis.gpstool.plugin.Plugin

getPluginDescription

public java.lang.String getPluginDescription()
Returns a description of the Plugin. The description should be human readable and understandable like "This plugin saves the content of the main window as an image in jpeg format". It is prefereable but not necessary that the description is localized.

Specified by:
getPluginDescription in interface org.dinopolis.gpstool.plugin.Plugin

getImageFormat

protected abstract java.lang.String getImageFormat()
Returns the format of the images in the form of the javax.imageio.ImageIO.write() method.


getContentType

public java.lang.String getContentType()
Returns the content type of the data the plugin produces (e.g. image/jpeg, ...).

Specified by:
getContentType in interface org.dinopolis.gpstool.plugin.WriteImagePlugin

getContentDescription

public java.lang.String getContentDescription()
Returns a short description of the content that may be used e.g. in a file chooser. If possible, the description should be localized.

Specified by:
getContentDescription in interface org.dinopolis.gpstool.plugin.WriteImagePlugin

getContentFileExtensions

public java.lang.String[] getContentFileExtensions()
Returns possible file extensions the the content. This information may be used in a file chooser as a filter (e.g. ["jpg","jpeg"]).

Specified by:
getContentFileExtensions in interface org.dinopolis.gpstool.plugin.WriteImagePlugin

getComponentScreenShot

public static java.awt.image.BufferedImage getComponentScreenShot(java.awt.Component component)
Returns an image of the component.


write

public void write(java.awt.Component component,
                  java.io.OutputStream out)
           throws java.io.IOException
Writes the data to the given output stream.

Specified by:
write in interface org.dinopolis.gpstool.plugin.WriteImagePlugin