adams.gui.print
Class TIFFWriter

java.lang.Object
  extended by adams.core.ConsoleObject
      extended by adams.core.option.AbstractOptionHandler
          extended by adams.gui.print.JComponentWriter
              extended by adams.gui.print.ScalableComponentWriter
                  extended by adams.gui.print.BufferedImageBasedWriter
                      extended by adams.gui.print.TIFFWriter
All Implemented Interfaces:
Debuggable, Destroyable, OptionHandler, SizeOfHandler, Serializable

public class TIFFWriter
extends BufferedImageBasedWriter

Outputs TIFF images.

Valid options are:

-D <int> (property: debugLevel)
    The greater the number the more additional info the scheme may output to 
    the console (0 = off).
    default: 0
    minimum: 0
 
-file <adams.core.io.PlaceholderFile> (property: file)
    The file to save the image to.
    default: ${CWD}
 
-custom-dimensions (property: useCustomDimensions)
    Whether to use custom dimensions or use the component's ones.
 
-custom-width <int> (property: customWidth)
    The custom width.
    default: -1
 
-custom-height <int> (property: customHeight)
    The custom height.
    default: -1
 
-scaling (property: scalingEnabled)
    If set to true, then scaling will be used.
 
-scale-x <double> (property: XScale)
    The scaling factor for the X-axis.
    default: 1.0
 
-scale-y <double> (property: YScale)
    The scaling factor for the Y axis.
    default: 1.0
 
-background <java.awt.Color> (property: background)
    The background color.
    default: #ffffff
 
-type <RGB|GRAY> (property: type)
    The type of image to create.
    default: RGB
 
-compress (property: compress)
    If set to true, the image will be compressed (LZW).
 

Version:
$Revision: 4612 $
Author:
FracPete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class adams.gui.print.BufferedImageBasedWriter
BufferedImageBasedWriter.Type
 
Field Summary
protected  boolean m_Compress
          whether to compress the image.
 
Fields inherited from class adams.gui.print.BufferedImageBasedWriter
m_Background, m_Type
 
Fields inherited from class adams.gui.print.ScalableComponentWriter
m_ScalingEnabled, m_xScale, m_yScale
 
Fields inherited from class adams.gui.print.JComponentWriter
m_Component, m_CustomHeight, m_CustomWidth, m_OutputFile, m_UseCustomDimensions
 
Fields inherited from class adams.core.option.AbstractOptionHandler
m_DebugLevel, m_OptionManager
 
Constructor Summary
TIFFWriter()
           
 
Method Summary
 String compressTipText()
          Returns the tip text for this property.
 void defineOptions()
          Adds options to the internal list of options.
 void generateOutput()
          generates the actual output.
 boolean getCompress()
          Returns whether to compress the image.
 String getDescription()
          returns the name of the writer, to display in the FileChooser.
 String[] getExtensions()
          returns the extensions (incl.
 String globalInfo()
          Returns a string describing the object.
 void setCompress(boolean value)
          Sets whether to compress the image.
 
Methods inherited from class adams.gui.print.BufferedImageBasedWriter
backgroundTipText, createBufferedImage, getBackground, getType, setBackground, setType, typeTipText
 
Methods inherited from class adams.gui.print.ScalableComponentWriter
getScalingEnabled, getXScale, getYScale, scalingEnabledTipText, setScalingEnabled, setXScale, setYScale, XScaleTipText, YScaleTipText
 
Methods inherited from class adams.gui.print.JComponentWriter
customHeightTipText, customWidthTipText, fileTipText, forCommandLine, forName, getComponent, getCustomHeight, getCustomWidth, getFile, getFileFilters, getUseCustomDimensions, getWriterForExtension, getWriterForFile, getWriterForFile, getWriters, main, setComponent, setCustomHeight, setCustomWidth, setFile, setUseCustomDimensions, toOutput, toOutput, toOutput, useCustomDimensionsTipText
 
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, debug, debug, debugLevelTipText, destroy, finishInit, getDebugLevel, getOptionManager, initialize, isDebugOn, newOptionManager, reset, setDebugLevel, toCommandLine, toString
 
Methods inherited from class adams.core.ConsoleObject
getDebugging, getSystemErr, getSystemOut, sizeOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_Compress

protected boolean m_Compress
whether to compress the image.

Constructor Detail

TIFFWriter

public TIFFWriter()
Method Detail

globalInfo

public String globalInfo()
Returns a string describing the object.

Specified by:
globalInfo in class AbstractOptionHandler
Returns:
a description suitable for displaying in the gui

defineOptions

public void defineOptions()
Adds options to the internal list of options.

Specified by:
defineOptions in interface OptionHandler
Overrides:
defineOptions in class BufferedImageBasedWriter

getDescription

public String getDescription()
returns the name of the writer, to display in the FileChooser.

Specified by:
getDescription in class JComponentWriter
Returns:
the name of the writer

getExtensions

public String[] getExtensions()
returns the extensions (incl. ".") of the output format, to use in the FileChooser.

Specified by:
getExtensions in class JComponentWriter
Returns:
the file extensions

setCompress

public void setCompress(boolean value)
Sets whether to compress the image.

Parameters:
value - if true then the image will be compressed

getCompress

public boolean getCompress()
Returns whether to compress the image.

Returns:
true if the image gets compressed

compressTipText

public String compressTipText()
Returns the tip text for this property.

Returns:
tip text for this property suitable for displaying in the GUI or for listing the options.

generateOutput

public void generateOutput()
                    throws Exception
generates the actual output.

Specified by:
generateOutput in class JComponentWriter
Throws:
Exception - if something goes wrong


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.